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);