From: Daiki Ueno Date: Tue, 22 Mar 2016 09:38:15 +0000 (+0900) Subject: javascript: Fix invalid memory access X-Git-Tag: v0.19.8~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2328b5b5a7e227ab1fb4dc1bccb39948e721aa76;p=thirdparty%2Fgettext.git javascript: Fix invalid memory access * gettext-tools/src/format-javascript.c (format_parse): Fix numbered_arg allocation for the unnumbered case. Reported by Roger Mc Murtrie in: . --- diff --git a/gettext-tools/src/format-javascript.c b/gettext-tools/src/format-javascript.c index 9c5ee0087..44814de90 100644 --- a/gettext-tools/src/format-javascript.c +++ b/gettext-tools/src/format-javascript.c @@ -232,7 +232,7 @@ format_parse (const char *format, bool translated, char *fdi, goto bad_format; } - if (spec.allocated == spec.numbered_arg_count) + if (spec.allocated == unnumbered_arg_count) { spec.allocated = 2 * spec.allocated + 1; spec.numbered = (struct numbered_arg *) xrealloc (spec.numbered, spec.allocated * sizeof (struct numbered_arg));