These lines generated errors when the format string was not a string
literal.
Signed-off-by: Russell Bryant <rbryant(a)redhat.com>
---
src/lib/mh_dbus_common.c | 8 ++++----
src/service/service-dbus.c | 8 ++++----
src/sysconfig/sysconfig-dbus.c | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/lib/mh_dbus_common.c b/src/lib/mh_dbus_common.c
index 874b207..2e3a3a5 100644
--- a/src/lib/mh_dbus_common.c
+++ b/src/lib/mh_dbus_common.c
@@ -71,7 +71,7 @@ check_authorization(const gchar *action, GError** error,
if (err != NULL) {
g_printerr("Error in obtaining authority: %s\n", err->message);
g_set_error(error, MATAHARI_ERROR, MH_RES_AUTHENTICATION_ERROR,
- err->message);
+ "%s", err->message);
g_error_free(err);
return FALSE;
}
@@ -83,7 +83,7 @@ check_authorization(const gchar *action, GError** error,
if (err != NULL) {
g_printerr("Error in checking authorization: %s\n", err->message);
g_set_error(error, MATAHARI_ERROR, MH_RES_AUTHENTICATION_ERROR,
- err->message);
+ "%s", err->message);
g_error_free(err);
return FALSE;
}
@@ -93,7 +93,7 @@ check_authorization(const gchar *action, GError** error,
g_object_unref(authority);
if (!res) {
g_set_error(error, MATAHARI_ERROR, MH_RES_AUTHENTICATION_ERROR,
- mh_result_to_str(MH_RES_AUTHENTICATION_ERROR));
+ "%s", mh_result_to_str(MH_RES_AUTHENTICATION_ERROR));
g_printerr("Caller is not authorized for action %s\n", action);
}
return res;
@@ -236,7 +236,7 @@ matahari_get(Matahari* matahari, const char *interface, const char
*name,
spec = g_object_class_find_property(G_OBJECT_GET_CLASS(matahari), name);
if (!spec) {
error = g_error_new(MATAHARI_ERROR, MH_RES_INVALID_ARGS,
- mh_result_to_str(MH_RES_INVALID_ARGS));
+ "%s", mh_result_to_str(MH_RES_INVALID_ARGS));
dbus_g_method_return_error(context, error);
g_error_free(error);
return FALSE;
diff --git a/src/service/service-dbus.c b/src/service/service-dbus.c
index 765db63..3d6d197 100644
--- a/src/service/service-dbus.c
+++ b/src/service/service-dbus.c
@@ -206,7 +206,7 @@ Services_fail(Matahari *matahari, const char *name,
}
// TODO: Implement when implemented in backend
error = g_error_new(MATAHARI_ERROR, MH_RES_NOT_IMPLEMENTED,
- mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
+ "%s", mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
dbus_g_method_return_error(context, error);
return TRUE;
}
@@ -223,7 +223,7 @@ Services_describe(Matahari *matahari, const char *name,
}
// TODO: Implement when implemented in backend
error = g_error_new(MATAHARI_ERROR, MH_RES_NOT_IMPLEMENTED,
- mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
+ "%s", mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
dbus_g_method_return_error(context, error);
g_error_free(error);
return TRUE;
@@ -339,7 +339,7 @@ Resources_describe(Matahari *matahari, const char *standard,
}
// TODO: Implement when implemented in backend
error = g_error_new(MATAHARI_ERROR, MH_RES_NOT_IMPLEMENTED,
- mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
+ "%s", mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
dbus_g_method_return_error(context, error);
g_error_free(error);
return TRUE;
@@ -439,7 +439,7 @@ Resources_fail(Matahari *matahari, const char *name, unsigned int rc,
}
// TODO: Implement when implemented in backend
error = g_error_new(MATAHARI_ERROR, MH_RES_NOT_IMPLEMENTED,
- mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
+ "%s", mh_result_to_str(MH_RES_NOT_IMPLEMENTED));
dbus_g_method_return_error(context, error);
g_error_free(error);
return TRUE;
diff --git a/src/sysconfig/sysconfig-dbus.c b/src/sysconfig/sysconfig-dbus.c
index 9f6fd01..895ce48 100644
--- a/src/sysconfig/sysconfig-dbus.c
+++ b/src/sysconfig/sysconfig-dbus.c
@@ -60,7 +60,7 @@ Sysconfig_run_uri(Matahari* matahari, const char *uri, uint flags,
dbus_g_method_return(context, status);
free(status);
} else {
- error = g_error_new(MATAHARI_ERROR, res, mh_result_to_str(res));
+ error = g_error_new(MATAHARI_ERROR, res, "%s", mh_result_to_str(res));
dbus_g_method_return_error(context, error);
g_error_free(error);
return FALSE;
@@ -91,7 +91,7 @@ Sysconfig_run_string(Matahari* matahari, const char *text, uint flags,
dbus_g_method_return(context, status);
free(status);
} else {
- error = g_error_new(MATAHARI_ERROR, res, mh_result_to_str(res));
+ error = g_error_new(MATAHARI_ERROR, res, "%s", mh_result_to_str(res));
dbus_g_method_return_error(context, error);
g_error_free(error);
return FALSE;
--
1.7.6.4