]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (test_mkfds) use memset explicitly to fill bpf_attr with zero
authorMasatake YAMATO <yamato@redhat.com>
Tue, 5 May 2026 19:37:30 +0000 (04:37 +0900)
committerKarel Zak <kzak@redhat.com>
Mon, 11 May 2026 09:44:48 +0000 (11:44 +0200)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/helpers/test_mkfds.c

index eb601e4c37fc7ef86722d92bf9abe9aae983c9e0..4bf99ef1d53f8156af3aaa89e0d6518eaedd6e35 100644 (file)
@@ -2977,12 +2977,13 @@ static void *make_bpf_map(const struct factory *factory, struct fdesc fdescs[],
        const char *sname = ARG_STRING(name);
 
        int bfd;
-       union bpf_attr attr = {
-               .map_type = imap_type_id,
-               .key_size = 4,
-               .value_size = 4,
-               .max_entries = 10,
-       };
+       union bpf_attr attr;
+
+       memset(&attr, 0, sizeof(attr));
+       attr.map_type = imap_type_id;
+       attr.value_size = 4;
+       attr.key_size = 4;
+       attr.max_entries = 10;
 
        strncpy(attr.map_name, sname, sizeof(attr.map_name) - 1);