[dia] [warningectomy] format string is not a string literal (potentially insecure)



commit 158e98c34e5e0c622eb0a04f39aeba3c5240c29d
Author: Hans Breuer <hans breuer org>
Date:   Wed Oct 1 23:52:08 2014 +0200

    [warningectomy] format string is not a string literal (potentially insecure)
    
    dia_xml.c:286:35: warning: format string is not a string literal (potentially insecure) 
[-Wformat-security]
        dia_context_add_message (ctx, error_xml->message);
                                      ^~~~~~~~~~~~~~~~~~
    diacairo-print.c:248:20: warning: format string is not a string literal (potentially insecure) 
[-Wformat-security]
        message_error (error->message);
                       ^~~~~~~~~~~~~~
    xfig-export.c:275:21: warning: format string is not a string literal (potentially insecure) 
[-Wformat-security]
        message_warning(renderer->warnings[warning]);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    load_save.c:1255:19: warning: format string is not a string literal (potentially insecure) 
[-Wformat-security]
              message_error (error->message);
                             ^~~~~~~~~~~~~~
    commands.c:507:35: warning: format string is not a string literal (potentially insecure) 
[-Wformat-security]
        dia_context_add_message (ctx, error->message);
                                      ^~~~~~~~~~~~~~

 app/commands.c                  |    2 +-
 app/load_save.c                 |    2 +-
 lib/dia_xml.c                   |    2 +-
 plug-ins/cairo/diacairo-print.c |    2 +-
 plug-ins/xfig/xfig-export.c     |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/app/commands.c b/app/commands.c
index d9f933f..a6aacea 100644
--- a/app/commands.c
+++ b/app/commands.c
@@ -504,7 +504,7 @@ _clipboard_get_data_callback (GtkClipboard     *clipboard,
     }
   }
   if (error) {
-    dia_context_add_message (ctx, error->message);
+    dia_context_add_message (ctx, "%s", error->message);
     g_error_free (error);
   }
   dia_context_release (ctx);
diff --git a/app/load_save.c b/app/load_save.c
index 8b76f84..6c8ec0f 100644
--- a/app/load_save.c
+++ b/app/load_save.c
@@ -1252,7 +1252,7 @@ diagram_autosave(Diagram *dia)
        asi->ctx = dia_context_new (_("Auto save"));
 
        if (!g_thread_create (_autosave_in_thread, asi, FALSE, &error)) {
-         message_error (error->message);
+         message_error ("%s", error->message);
          g_error_free (error);
        }
        /* FIXME: need better synchronization */
diff --git a/lib/dia_xml.c b/lib/dia_xml.c
index 5afda2b..2425cb9 100644
--- a/lib/dia_xml.c
+++ b/lib/dia_xml.c
@@ -283,7 +283,7 @@ xmlDiaParseFile(const char *filename, DiaContext *ctx)
     ret = xmlDoParseFile(filename, &error_xml);
   }
   if (error_xml)
-    dia_context_add_message (ctx, error_xml->message);
+    dia_context_add_message (ctx, "%s", error_xml->message);
   return ret;
 }
 
diff --git a/plug-ins/cairo/diacairo-print.c b/plug-ins/cairo/diacairo-print.c
index 2721297..9410262 100644
--- a/plug-ins/cairo/diacairo-print.c
+++ b/plug-ins/cairo/diacairo-print.c
@@ -245,7 +245,7 @@ cairo_print_callback (DiagramData *data,
   
   res = gtk_print_operation_run (op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, NULL, &error);
   if (GTK_PRINT_OPERATION_RESULT_ERROR == res) {
-    message_error (error->message);
+    message_error ("%s", error->message);
     g_error_free (error);
   }
   return NULL;
diff --git a/plug-ins/xfig/xfig-export.c b/plug-ins/xfig/xfig-export.c
index 2d7ed3b..d7c6e1a 100644
--- a/plug-ins/xfig/xfig-export.c
+++ b/plug-ins/xfig/xfig-export.c
@@ -272,7 +272,7 @@ static void
 figWarn(XfigRenderer *renderer, int warning) 
 {
   if (renderer->warnings[warning]) {
-    message_warning(renderer->warnings[warning]);
+    message_warning("%s", renderer->warnings[warning]);
     renderer->warnings[warning] = NULL;
   }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]