From 527f70e540b68bcdb338cd5a133bbf17daf0105a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 22 Feb 2005 12:10:30 +0000 Subject: Curl_base64_decode() now returns an allocated buffer --- tests/server/getpart.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/server') diff --git a/tests/server/getpart.c b/tests/server/getpart.c index 45576fafd..fa0f9cf52 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -61,11 +61,11 @@ char *appendstring(char *string, /* original string */ { size_t len = strlen(buffer); size_t needed_len = len + *stringlen + 1; - char buf64[256]; /* big enough? */ + unsigned char *buf64=NULL; if(base64) { /* decode the given buffer first */ - len = Curl_base64_decode(buffer, buf64); /* updated len */ + len = Curl_base64_decode(buffer, &buf64); /* updated len */ buffer = buf64; needed_len = len + *stringlen + 1; /* recalculate */ } @@ -87,6 +87,9 @@ char *appendstring(char *string, /* original string */ *stringlen += len; string[*stringlen]=0; + if(buf64) + free(buf64); + return string; } -- cgit v1.2.3