]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
profile: fix edge-case where magic is zero
authorShachar Sharon <ssharon@redhat.com>
Sun, 12 Apr 2026 12:05:10 +0000 (15:05 +0300)
committerAnoop C S <anoopcs@samba.org>
Thu, 21 May 2026 05:38:37 +0000 (05:38 +0000)
For the edge case, where the first 8-bytes of digest are all zero, pull
the next 8-bytes as 64LE.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/profile/profile_read.c

index 8284e1d81be204681d1ba41f9cd23668ec671077..86e68c1eda2579670ea7d248742444ac856ca2fd 100644 (file)
@@ -183,8 +183,8 @@ out:
 
        if (rc == 0) {
                uint64_t magic = PULL_LE_U64(digest, 0);
-               if (magic == 0) {
-                       magic = PULL_LE_U64(digest, 0);
+               if ((magic == 0) && (sizeof(digest) >= 16)) {
+                       magic = PULL_LE_U64(digest, 8);
                }
                *_magic = magic;
        }