summaryrefslogtreecommitdiff
path: root/lib/base64.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-12 13:23:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-12 13:23:17 +0000
commit8e09a389c49486031f19535ff041387380b38403 (patch)
treee08b545bdcd483ea0b39d6e5b8703b9f9cb5b4cd /lib/base64.c
parentaa3ae01878b3178e593af6f9206ef3874de7b91c (diff)
downloadcurl-8e09a389c49486031f19535ff041387380b38403.tar.gz
make sure the returned pointer is NULL when encoding fails
Diffstat (limited to 'lib/base64.c')
-rw-r--r--lib/base64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/base64.c b/lib/base64.c
index 70e5e5cc2..987835b4f 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);