summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util_str.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 1e1108132c..7cb57adbb5 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -2347,7 +2347,9 @@ char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data)
out_cnt = 0;
len = data.length;
- output_len = data.length * 2;
+ output_len = data.length * 2 + 4; /* Account for closing bytes. 4 is
+ * random but should be enough for
+ * the = and \0 */
result = TALLOC_ARRAY(mem_ctx, char, output_len); /* get us plenty of space */
SMB_ASSERT(result != NULL);