aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-14 18:21:17 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-14 18:21:17 +0000
commit39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b (patch)
tree89709eeeaf709fbe4b97be978efd25932965f1cf
parent1bc35ab9741ab65104ae15cbed0f7587b549d09c (diff)
downloadlibmicrohttpd-39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b.tar.gz
libmicrohttpd-39b6c2e1c5b8a0dea9c9c1df0f9bab8e71b1353b.zip
nullcheck
-rw-r--r--src/daemon/base64.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/daemon/base64.c b/src/daemon/base64.c
index 8ea73006..d99209e2 100644
--- a/src/daemon/base64.c
+++ b/src/daemon/base64.c
@@ -68,8 +68,9 @@ char* BASE64Decode(const char* src) {
68 /* Wrong base64 string length */ 68 /* Wrong base64 string length */
69 return NULL; 69 return NULL;
70 } 70 }
71 result = dest = (char*) malloc(in_len / 4 * 3 + 1); 71 result = dest = malloc(in_len / 4 * 3 + 1);
72 72 if (result == NULL)
73 return NULL; /* out of memory */
73 while (*src) { 74 while (*src) {
74 char a = base64_digits[(unsigned char)*(src++)]; 75 char a = base64_digits[(unsigned char)*(src++)];
75 char b = base64_digits[(unsigned char)*(src++)]; 76 char b = base64_digits[(unsigned char)*(src++)];