File dia-cve-2006-2453.patch of Package dia
--- app/app_procs.c
+++ app/app_procs.c
@@ -897,22 +897,22 @@
g_print(_("The original author of Dia was:\n\n"));
for (i = 0; i < NUMBER_OF_ORIG_AUTHORS; i++) {
- g_print(authors[i]); g_print("\n");
+ g_print("%s\n", authors[i]);
}
g_print(_("\nThe current maintainers of Dia are:\n\n"));
for (i = NUMBER_OF_ORIG_AUTHORS; i < NUMBER_OF_ORIG_AUTHORS + NUMBER_OF_MAINTAINERS; i++) {
- g_print(authors[i]); g_print("\n");
+ g_print("%s\n", authors[i]);
}
g_print(_("\nOther authors are:\n\n"));
for (i = NUMBER_OF_ORIG_AUTHORS + NUMBER_OF_MAINTAINERS; i < nauthors; i++) {
- g_print(authors[i]); g_print("\n");
+ g_print("%s\n", authors[i]);
}
g_print(_("\nDia is documented by:\n\n"));
for (i = 0; i < ndocumentors; i++) {
- g_print(documentors[i]); g_print("\n");
+ g_print("%s\n", documentors[i]);
}
exit(0);
--- app/display.c
+++ app/display.c
@@ -968,7 +968,6 @@
Diagram *dia;
GtkWidget *dialog, *button;
gchar *fname;
- gchar *msg;
dia = ddisp->diagram;
@@ -981,18 +980,14 @@
fname = dia->filename;
if (!fname)
fname = _("<unnamed>");
- msg = g_strdup_printf (
- _("The diagram '%s'\n"
- "has not been saved. Save changes now?"),
- fname);
dialog = gtk_message_dialog_new(GTK_WINDOW (ddisp->shell),
GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_NONE, /* no standard buttons */
- msg,
- NULL);
- g_free (msg);
+ _("The diagram '%s'\n"
+ "has not been saved. Save changes now?"),
+ fname);
gtk_window_set_title (GTK_WINDOW(dialog), _("Close Diagram"));
button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
--- app/filedlg.c
+++ app/filedlg.c
@@ -251,7 +251,6 @@
if (stat(filename, &stat_struct) == 0) {
GtkWidget *dialog = NULL;
- char buffer[300];
char *utf8filename = NULL;
if (!g_utf8_validate(filename, -1, NULL)) {
utf8filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
@@ -261,15 +260,12 @@
}
if (utf8filename == NULL) utf8filename = g_strdup(filename);
- g_snprintf(buffer, 300,
- _("The file '%s' already exists.\n"
- "Do you want to overwrite it?"), utf8filename);
- g_free(utf8filename);
-
dialog = gtk_message_dialog_new (GTK_WINDOW(fs),
GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- buffer);
+ _("The file '%s' already exists.\n"
+ "Do you want to overwrite it?"), utf8filename);
+ g_free(utf8filename);
gtk_window_set_title (GTK_WINDOW (dialog), _("File already exists"));
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
@@ -442,16 +438,13 @@
if (stat(filename, &statbuf) == 0) {
GtkWidget *dialog = NULL;
- char buffer[300];
- g_snprintf(buffer, 300,
- _("The file '%s' already exists.\n"
- "Do you want to overwrite it?"), filename);
dialog = gtk_message_dialog_new (GTK_WINDOW(fs),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- buffer);
+ _("The file '%s' already exists.\n"
+ "Do you want to overwrite it?"), filename);
gtk_window_set_title (GTK_WINDOW (dialog), _("File already exists"));
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
--- app/load_save.c
+++ app/load_save.c
@@ -199,7 +199,7 @@
g_hash_table_foreach(unknown_hash,
GHFuncUnknownObjects,
unknown_str);
- message_error(unknown_str->str);
+ message_error("%s", unknown_str->str);
}
g_hash_table_destroy(unknown_hash);
g_string_free(unknown_str, TRUE);
--- app/sheets.c
+++ app/sheets.c
@@ -338,7 +338,7 @@
gdk_pixbuf_render_pixmap_and_mask(pixbuf, pixmap, mask, 1.0);
gdk_pixbuf_unref(pixbuf);
} else {
- g_warning (error->message);
+ g_warning ("%s", error->message);
g_error_free (error);
}
}
--- plug-ins/python/diamodule.c
+++ plug-ins/python/diamodule.c
@@ -377,11 +377,11 @@
return NULL;
if (0 == type)
- message_notice (text);
+ message_notice ("%s", text);
else if (1 == type)
- message_warning (text);
+ message_warning ("%s", text);
else
- message_error (text);
+ message_error ("%s", text);
Py_INCREF(Py_None);
return Py_None;
--- plug-ins/python/pydia-error.c
+++ plug-ins/python/pydia-error.c
@@ -98,7 +98,7 @@
if (self->str)
g_string_append (self->str, s);
- g_print (s);
+ g_print ("%s", s);
Py_INCREF(Py_None);
return Py_None;
--- plug-ins/wmf/wmf.cpp
+++ plug-ins/wmf/wmf.cpp
@@ -223,7 +223,7 @@
va_end (args);
//fprintf(renderer->file, string);
- g_print(string);
+ g_print("%s", string);
g_free(string);
}
--- plug-ins/xfig/xfig-export.c
+++ plug-ins/xfig/xfig-export.c
@@ -263,7 +263,7 @@
figWarn(XfigRenderer *renderer, int warning)
{
if (renderer->warnings[warning]) {
- message_warning(renderer->warnings[warning]);
+ message_warning("%s", renderer->warnings[warning]);
renderer->warnings[warning] = NULL;
}
}