summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Schleifer <js@webkeks.org>2011-06-27 01:40:06 +0200
committerJonathan Schleifer <js@webkeks.org>2011-06-27 01:40:06 +0200
commit08147856da0abe991773b5130315400c8ef84990 (patch)
tree989c655671b1d5a7423588f759e4248905cfadd8
parentcf5346e25dcd32c0fc06e309e7ba2bfa8cf88c45 (diff)
Check the item size of the passed data array in of_base64_decode().
-rw-r--r--src/base64.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/base64.m b/src/base64.m
index dec97bf4..4b56a033 100644
--- a/src/base64.m
+++ b/src/base64.m
@@ -105,6 +105,9 @@ of_base64_decode(OFDataArray *data, const char *str, size_t len)
if ((len & 3) != 0)
return NO;
+ if ([data itemSize] != 1)
+ return NO;
+
for (i = 0; i < len; i += 4) {
uint32_t sb = 0;
uint8_t cnt = 3;