Always include +1 for the size. 0*2 == 0, so malloc returns NULL, which is
2001-01-29 Not Zed <NotZed@Ximian.com> * gal/widgets/e-unicode.c (e_utf8_xml1_decode): Always include +1 for the size. 0*2 == 0, so malloc returns NULL, which is not what we want. svn path=/trunk/; revision=7885
This commit is contained in:
@ -481,7 +481,7 @@ e_utf8_xml1_decode (const gchar *text)
|
||||
|
||||
g_return_val_if_fail (text != NULL, NULL);
|
||||
|
||||
len = strlen (text);
|
||||
len = strlen (text)+1;
|
||||
/* len * 2 is absolute maximum */
|
||||
u = d = g_malloc (len * 2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user