summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Filippo Bigarella2016-10-31 02:43:15 +0100
committerGravatar Nikias Bassen2016-10-31 02:43:15 +0100
commit62bac060ed5ee6d64a71edf6cc627cc184ae87e5 (patch)
tree08e5cac1aa1fb0c27c2e333b5100fba015f593ae
parenteec2e855b4f192cb1808d1f02b6bc8935a979025 (diff)
downloadlibplist-62bac060ed5ee6d64a71edf6cc627cc184ae87e5.tar.gz
libplist-62bac060ed5ee6d64a71edf6cc627cc184ae87e5.tar.bz2
base64: Prevent buffer overflow by not decoding blocks with less than 4 chars
-rw-r--r--src/base64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/base64.c b/src/base64.c
index e59d963..1595bd0 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -118,7 +118,7 @@ unsigned char *base64decode(const char *buf, size_t *size)
break;
}
len = strcspn(ptr, "\r\n\t ");
- if (len > 0) {
+ if (len > 3) {
p+=base64decode_block(outbuf+p, ptr, len);
ptr += len;
} else {