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:
parent
939e75126e
commit
ea110de1dc
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user