printf: fix invalid memory access in case of %%

https://bugzilla.gnome.org/show_bug.cgi?id=748414
This commit is contained in:
Tim-Philipp Müller 2015-04-24 15:16:24 +01:00
parent db765a5fb8
commit f4b2905700

View file

@ -234,6 +234,11 @@ printf_postprocess_args (char_directives * directives, arguments * arguments)
argument *a; argument *a;
dp = &directives->dir[i]; dp = &directives->dir[i];
/* %% has no arguments, for example */
if (dp->arg_index < 0)
continue;
a = &arguments->arg[dp->arg_index]; a = &arguments->arg[dp->arg_index];
if (a->type == TYPE_POINTER_EXT) { if (a->type == TYPE_POINTER_EXT) {