]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
reparse: Tighten reparse point length check
authorVolker Lendecke <vl@samba.org>
Sat, 4 May 2024 08:54:27 +0000 (10:54 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 6 May 2024 20:55:37 +0000 (20:55 +0000)
test_create_reparse shows that the length checks need to be precise,
not just checking for overflow.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/reparse.c

index 49ecc77725de74a243800dca7e2011f7b5c6bc36..ab0cf39e8a9c87a088dfbae26b0ec5d976f6d9cb 100644 (file)
@@ -45,7 +45,7 @@ static NTSTATUS reparse_buffer_check(const uint8_t *in_data,
 
        reparse_data_length = PULL_LE_U16(in_data, 4);
 
-       if (reparse_data_length > (in_len - 8)) {
+       if (reparse_data_length != (in_len - 8)) {
                DBG_DEBUG("in_len=%zu, reparse_data_length=%" PRIu16 "\n",
                          in_len,
                          reparse_data_length);