mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
r5158: BUG 2263: patch from Timur Bakeyev <timur@com.bat.ru> to guard base64_encode_data_blob() against empty blobs
(This used to be commit 17239d609f
)
This commit is contained in:
parent
6c6e231f15
commit
6fd5918b06
@ -2016,10 +2016,16 @@ char * base64_encode_data_blob(DATA_BLOB data)
|
||||
{
|
||||
int bits = 0;
|
||||
int char_count = 0;
|
||||
size_t out_cnt = 0;
|
||||
size_t len = data.length;
|
||||
size_t output_len = data.length * 2;
|
||||
char *result = SMB_MALLOC(output_len); /* get us plenty of space */
|
||||
size_t out_cnt, len, output_len;
|
||||
char *result;
|
||||
|
||||
if (!data.length || !data.data)
|
||||
return NULL;
|
||||
|
||||
out_cnt = 0;
|
||||
len = data.length;
|
||||
output_len = data.length * 2;
|
||||
result = SMB_MALLOC(output_len); /* get us plenty of space */
|
||||
|
||||
while (len-- && out_cnt < (data.length * 2) - 5) {
|
||||
int c = (unsigned char) *(data.data++);
|
||||
|
Loading…
Reference in New Issue
Block a user