From e1b7a25342364562fd43d9ef3c0a5e7586592dc9 Mon Sep 17 00:00:00 2001 From: Paolo Borelli Date: Mon, 23 Feb 2009 14:38:20 +0000 Subject: [PATCH] sanity check the input paramter. 2009-02-23 Paolo Borelli * glib/gutf8.c (_g_utf8_make_valid): sanity check the input paramter. svn path=/trunk/; revision=7902 --- ChangeLog | 5 +++++ glib/gutf8.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f72d954..9e164c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-23 Paolo Borelli + + * glib/gutf8.c (_g_utf8_make_valid): + sanity check the input paramter. + 2009-02-23 Tor Lillqvist Bug 570501 - g_win32_get_system_data_dirs uses invalid conversion diff --git a/glib/gutf8.c b/glib/gutf8.c index bf06458..da4a769 100644 --- a/glib/gutf8.c +++ b/glib/gutf8.c @@ -1833,11 +1833,13 @@ _g_utf8_make_valid (const gchar *name) GString *string; const gchar *remainder, *invalid; gint remaining_bytes, valid_bytes; - + + g_return_val_if_fail (name != NULL, NULL); + string = NULL; remainder = name; remaining_bytes = strlen (name); - + while (remaining_bytes != 0) { if (g_utf8_validate (remainder, remaining_bytes, &invalid)) -- 2.7.4