summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2016-03-22 18:38:15 +0900
committerDaiki Ueno <ueno@gnu.org>2016-03-22 18:38:15 +0900
commit2328b5b5a7e227ab1fb4dc1bccb39948e721aa76 (patch)
treef8910e343a446c695467a5829023ede1b7fb566e
parent9e106a164ded072601460e1a734c76690bd4cfd4 (diff)
downloadexternal_gettext-2328b5b5a7e227ab1fb4dc1bccb39948e721aa76.zip
external_gettext-2328b5b5a7e227ab1fb4dc1bccb39948e721aa76.tar.gz
external_gettext-2328b5b5a7e227ab1fb4dc1bccb39948e721aa76.tar.bz2
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: <http://savannah.gnu.org/bugs/?47492>.
-rw-r--r--gettext-tools/src/format-javascript.c2
1 files changed, 1 insertions, 1 deletions
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));