mirror of
https://github.com/samba-team/samba.git
synced 2025-11-08 16:23:49 +03:00
r15744: convert_string_talloc() handles src_len == 0 as error
but it's valid in this case metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
012a08cfb9
commit
92c19b1ba4
@@ -522,6 +522,14 @@ NTSTATUS smb2_pull_o16s16_string(struct smb2_request_buffer *buf, TALLOC_CTX *me
|
|||||||
status = smb2_pull_o16s16_blob(buf, mem_ctx, ptr, &blob);
|
status = smb2_pull_o16s16_blob(buf, mem_ctx, ptr, &blob);
|
||||||
NT_STATUS_NOT_OK_RETURN(status);
|
NT_STATUS_NOT_OK_RETURN(status);
|
||||||
|
|
||||||
|
if (blob.length == 0) {
|
||||||
|
char *s;
|
||||||
|
s = talloc_strdup(mem_ctx, "");
|
||||||
|
NT_STATUS_HAVE_NO_MEMORY(s);
|
||||||
|
*str = s;
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
size = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
|
size = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
|
||||||
blob.data, blob.length, &vstr);
|
blob.data, blob.length, &vstr);
|
||||||
data_blob_free(&blob);
|
data_blob_free(&blob);
|
||||||
|
|||||||
Reference in New Issue
Block a user