1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Fix a segfault in base64_encode_data_blob

We did not allocate enough memory for the \0 and a = at the end
This commit is contained in:
Volker Lendecke 2008-07-10 18:12:24 +02:00
parent 939e75126e
commit ea110de1dc

View File

@ -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);