commit d98d7e1bb3c7bcb009c32c2afd63d46a41414a39
Author: phantomjinx <[email protected]>
Date: Sun Mar 13 19:09:47 2011 +0000
Avoid possible syntax crash
* If %s contains another % then this may cause a crash when forming
a gtkpod_warning
libgtkpod/file_itunesdb.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/libgtkpod/file_itunesdb.c b/libgtkpod/file_itunesdb.c
index cad6af1..d947106 100644
--- a/libgtkpod/file_itunesdb.c
+++ b/libgtkpod/file_itunesdb.c
@@ -1680,12 +1680,18 @@ static gboolean gp_write_itdb(iTunesDB *itdb) {
if (success) { /* write shuffle data */
if (!itdb_shuffle_write(itdb, &error)) { /* an error occurred */
success = FALSE;
- if (error && error->message)
- gtkpod_warning("%s\n\n", error->message);
- else
+ if (error && error->message) {
+ gchar *msg = g_strdup_printf("%s\n\n", error->message);
+ gtkpod_warning(msg);
+ g_free(msg);
+ }
+ else
g_warning ("error->message == NULL!\n");
- g_error_free(error);
- error = NULL;
+
+ if (error) {
+ g_error_free(error);
+ error = NULL;
+ }
}
}
if (success) {
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2