sanity check the input paramter.

2009-02-23  Paolo Borelli  <pborelli@katamail.com>

	* glib/gutf8.c (_g_utf8_make_valid):
	sanity check the input paramter. 

svn path=/trunk/; revision=7902
This commit is contained in:
Paolo Borelli 2009-02-23 14:38:20 +00:00 committed by Paolo Borelli
parent 450b6fff14
commit e1b7a25342
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-02-23 Paolo Borelli <pborelli@katamail.com>
* glib/gutf8.c (_g_utf8_make_valid):
sanity check the input paramter.
2009-02-23 Tor Lillqvist <tml@novell.com>
Bug 570501 - g_win32_get_system_data_dirs uses invalid conversion

View File

@ -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))