summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/roken/base64.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/roken/base64.c')
-rw-r--r--source4/heimdal/lib/roken/base64.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/heimdal/lib/roken/base64.c b/source4/heimdal/lib/roken/base64.c
index 5e720eb6d4..bc74391b56 100644
--- a/source4/heimdal/lib/roken/base64.c
+++ b/source4/heimdal/lib/roken/base64.c
@@ -58,6 +58,11 @@ base64_encode(const void *data, int size, char **str)
int c;
const unsigned char *q;
+ if (size > INT_MAX/4 || size < 0) {
+ *str = NULL;
+ return -1;
+ }
+
p = s = (char *) malloc(size * 4 / 3 + 4);
if (p == NULL) {
*str = NULL;