Perl bindings fix: Not enough memory was allocated for array params.

This commit is contained in:
Richard Jones
2009-05-11 10:51:21 +01:00
parent d43dac6948
commit 09128ca421
3 changed files with 3 additions and 2 deletions

1
BUGS
View File

@@ -54,3 +54,4 @@ quite hard to fix cleanly.
[perl] Perl bindings cause a segfault when you call any command which
takes a StringList (eg. $g->command).
[should be fixed now]

View File

@@ -68,7 +68,7 @@ XS_unpack_charPtrPtr (SV *arg) {
croak ("array reference expected");
av = (AV *)SvRV (arg);
ret = malloc (av_len (av) + 1 + 1);
ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *));
if (!ret)
croak ("malloc failed");

View File

@@ -4862,7 +4862,7 @@ XS_unpack_charPtrPtr (SV *arg) {
croak (\"array reference expected\");
av = (AV *)SvRV (arg);
ret = malloc (av_len (av) + 1 + 1);
ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *));
if (!ret)
croak (\"malloc failed\");