mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
Fixed bug in get_length_upper_bound where g_print-ing a NULL string would cause a segfault
This commit is contained in:
parent
e2f5eb1c3e
commit
f7443e0e85
@ -322,6 +322,7 @@ get_length_upper_bound (gchar* fmt, va_list *args)
|
||||
int short_int;
|
||||
int long_int;
|
||||
int done;
|
||||
char *tmp;
|
||||
|
||||
while (*fmt)
|
||||
{
|
||||
@ -362,7 +363,11 @@ get_length_upper_bound (gchar* fmt, va_list *args)
|
||||
/* I ignore 'q' and 'L', they're not portable anyway. */
|
||||
|
||||
case 's':
|
||||
len += strlen (va_arg (*args, char *));
|
||||
tmp = va_arg(*args, char *);
|
||||
if(tmp)
|
||||
len += strlen (tmp);
|
||||
else
|
||||
len += strlen ("(null)");
|
||||
done = TRUE;
|
||||
break;
|
||||
case 'd':
|
||||
|
Loading…
Reference in New Issue
Block a user