From: Daniel Stenberg Date: Wed, 12 May 2004 13:23:17 +0000 (+0000) Subject: make sure the returned pointer is NULL when encoding fails X-Git-Tag: curl-7_12_0~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e09a389c49486031f19535ff041387380b38403;p=thirdparty%2Fcurl.git make sure the returned pointer is NULL when encoding fails --- diff --git a/lib/base64.c b/lib/base64.c index 70e5e5cc24..987835b4f4 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -132,6 +132,8 @@ size_t Curl_base64_encode(const char *inp, size_t insize, char **outptr) char *indata = (char *)inp; + *outptr = NULL; /* set to NULL in case of failure before we reach the end */ + if(0 == insize) insize = strlen(indata);