]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: Use all_zero() to check for an all-0 buffer
authorVolker Lendecke <vl@samba.org>
Wed, 1 Oct 2025 15:23:16 +0000 (17:23 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 8 Oct 2025 08:01:30 +0000 (08:01 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fruit.c

index d2d6c9f47b1687c4782c4e57844a7194907d8d43..4e3ae2832a77c764731b6fb0d0f19d94475f918d 100644 (file)
@@ -470,8 +470,6 @@ static bool del_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 
 static bool ad_empty_finderinfo(const struct adouble *ad)
 {
-       int cmp;
-       char emptybuf[ADEDLEN_FINDERI] = {0};
        char *fi = NULL;
 
        fi = ad_get_entry(ad, ADEID_FINDERI);
@@ -479,18 +477,12 @@ static bool ad_empty_finderinfo(const struct adouble *ad)
                DBG_ERR("Missing FinderInfo in struct adouble [%p]\n", ad);
                return false;
        }
-
-       cmp = memcmp(emptybuf, fi, ADEDLEN_FINDERI);
-       return (cmp == 0);
+       return all_zero((const uint8_t *)fi, ADEDLEN_FINDERI);
 }
 
 static bool ai_empty_finderinfo(const AfpInfo *ai)
 {
-       int cmp;
-       char emptybuf[ADEDLEN_FINDERI] = {0};
-
-       cmp = memcmp(emptybuf, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
-       return (cmp == 0);
+       return all_zero(&ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
 }
 
 /**