SHA256
3
0
forked from pool/bash
bash/bash-3.2-valgrind.patch

19 lines
612 B
Diff

--- array.c
+++ array.c 2007-02-28 11:17:18.000000000 +0000
@@ -649,13 +649,14 @@ int quoted;
result = (char *)xmalloc (rsize = 128);
result[0] = '(';
+ indstr[0] = '\0';
rlen = 1;
for (ae = element_forw(a->head); ae != a->head; ae = element_forw(ae)) {
is = inttostr (element_index(ae), indstr, sizeof(indstr));
valstr = element_value (ae) ? sh_double_quote (element_value(ae))
: (char *)NULL;
- elen = STRLEN (indstr) + 8 + STRLEN (valstr);
+ elen = STRLEN (is) + 3 + STRLEN (valstr);
RESIZE_MALLOCED_BUFFER (result, rlen, (elen + 1), rsize, rsize);
result[rlen++] = '[';