From 2328b5b5a7e227ab1fb4dc1bccb39948e721aa76 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Tue, 22 Mar 2016 18:38:15 +0900 Subject: 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: . --- gettext-tools/src/format-javascript.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gettext-tools/src/format-javascript.c b/gettext-tools/src/format-javascript.c index 9c5ee00..44814de 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)); -- cgit v1.1