1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

util:datablob: data_blob_pad checks its alignment assumption

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

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Dec 20 07:59:51 UTC 2024 on atb-devel-224
This commit is contained in:
Douglas Bagnall 2024-12-11 14:31:18 +13:00 committed by Andreas Schneider
parent 929f4d0ca5
commit 8b84282008

View File

@ -290,7 +290,7 @@ _PUBLIC_ bool data_blob_pad(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
size_t old_len = blob->length;
size_t new_len = (old_len + pad - 1) & ~(pad - 1);
if (new_len < old_len) {
if (new_len < old_len || (pad & (pad - 1)) != 0) {
return false;
}