g_lock: Fix buffer length check in g_lock_parse()
authorVolker Lendecke <vl@samba.org>
Sat, 10 Feb 2024 10:15:58 +0000 (11:15 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 15 May 2024 16:51:39 +0000 (16:51 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/g_lock.c

index 33f088b2a438fcc98a7dbf289ec5e1f5107a9ed7..f1857c35e70ebbd6726c99f08efb15b2458b0aa5 100644 (file)
@@ -58,7 +58,8 @@ static bool g_lock_parse(uint8_t *buf, size_t buflen, struct g_lock *lck)
        uint64_t unique_data_epoch;
 
        if (buflen < (SERVER_ID_BUF_LENGTH + /* exclusive */
-                     sizeof(uint64_t) +     /* seqnum */
+                     sizeof(uint64_t) +     /* unique_lock_epoch */
+                     sizeof(uint64_t) +     /* unique_data_epoch */
                      sizeof(uint32_t))) {   /* num_shared */
                struct g_lock ret = {
                        .exclusive.pid = 0,