After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 554567 - warning fixes (missing format specifiers and NULL vs 0)
warning fixes (missing format specifiers and NULL vs 0)
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-10-01 13:31 UTC by Kjartan Maraas
Modified: 2008-11-21 14:54 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
patch for warnings (5.70 KB, patch)
2008-10-01 13:32 UTC, Kjartan Maraas
accepted-commit_now Details | Review
updated patch (5.97 KB, patch)
2008-10-03 09:11 UTC, Kjartan Maraas
accepted-commit_now Details | Review

Description Kjartan Maraas 2008-10-01 13:31:37 UTC
Attaching a patch.
Comment 1 Kjartan Maraas 2008-10-01 13:32:13 UTC
Created attachment 119723 [details] [review]
patch for warnings
Comment 2 Christian Persch 2008-10-01 16:14:44 UTC
       g_set_error (&priv->error,
 		   GTK_PRINT_ERROR,
 		   GTK_PRINT_ERROR_GENERAL,
+		   "%s",
 		   cairo_status_to_string (cairo_surface_status (surface)));

You can use g_set_error_literal in this case.
Comment 3 Matthias Clasen 2008-10-01 18:29:52 UTC
Yes, with that one change to use g_set_error_literal, it looks fine.
Comment 4 Kjartan Maraas 2008-10-03 09:11:20 UTC
Created attachment 119845 [details] [review]
updated patch

Does this look ok then?
Comment 5 Matthias Clasen 2008-11-04 06:06:30 UTC
yes, looks fine
Comment 6 Kjartan Maraas 2008-11-08 11:32:25 UTC
This was already done on trunk it seems. Close it or apply it to 2.14.x too?
Comment 7 Tim Janik 2008-11-14 17:00:04 UTC
(In reply to comment #4)
> Created an attachment (id=119845) [edit]
> updated patch
> 
> Does this look ok then?

Yes, please apply and close this bug.
Comment 8 Christian Dywan 2008-11-14 17:45:54 UTC
(In reply to comment #7)
> (In reply to comment #4)
> > Created an attachment (id=119845) [edit]
> > updated patch
> > 
> > Does this look ok then?
> 
> Yes, please apply and close this bug.

The patch was already applied, the only question is whether it should also go into 2.14 or not. I personally don't think it's worth it, though.
Comment 9 Tim Janik 2008-11-14 17:51:13 UTC
(In reply to comment #6)
> This was already done on trunk it seems. Close it or apply it to 2.14.x too?

This should go into 2.14 as well, because printf variants with a custom unchecked format string are potential security holes (e.g. as "%s" causes references to random/invalid memory addresses).
Comment 10 Kjartan Maraas 2008-11-21 14:54:56 UTC
Commited. Thanks.