]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: init new bitfield word after realloc 15252/head
authorMark Stapp <mjs@labn.net>
Mon, 29 Jan 2024 17:56:28 +0000 (12:56 -0500)
committerMark Stapp <mjs@labn.net>
Mon, 29 Jan 2024 17:56:28 +0000 (12:56 -0500)
Realloc doesn't init - ensure a newly-allocated word is inited.

Signed-off-by: Mark Stapp <mjs@labn.net>
lib/bitfield.h

index cc8c3114161025d813a39a7fc0d49765df4bed34..3fda627b744016dc8ea9423729fb58e821535286 100644 (file)
@@ -116,6 +116,7 @@ DECLARE_MTYPE(BITFIELD);
                        (v).m = (v).m + 1;                                     \
                        (v).data = XREALLOC(MTYPE_BITFIELD, (v).data,          \
                                            (v).m * sizeof(word_t));           \
+                       (v).data[(v).m - 1] = 0;                               \
                }                                                              \
        } while (0)