1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

lib/util: data_blob_append() should not fail if both parts have length=0

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15050

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2022-04-28 16:08:42 +02:00 committed by Jeremy Allison
parent bc22d5ebf9
commit 8ca99c25ba
2 changed files with 5 additions and 2 deletions

View File

@ -229,6 +229,11 @@ _PUBLIC_ bool data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
{
size_t old_len = blob->length;
size_t new_len = old_len + length;
if (length == 0) {
return true;
}
if (new_len < length || new_len < old_len) {
return false;
}

View File

@ -1,2 +0,0 @@
^samba4.local.datablob.append_NULL_0
^samba4.local.datablob.append_empty_0