From 790009f58ea8ebacfd3a66b936240cd19c27a42e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 3 Mar 2026 23:17:02 +0000 Subject: util/nvmutil: reset macbuf in parse_mac_string we only ever use it once, so it's fine, but future expansion of this code might trip us up. this is therefore a preventative bug fix. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 2dd3028f..585b4cee 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -285,6 +285,8 @@ parse_mac_string(void) if (strnlen(mac, 20) != 17) err(EINVAL, "Invalid MAC address string length"); + (void) memset(macbuf, 0, sizeof(macbuf)); + for (mac_pos = 0; mac_pos < 16; mac_pos += 3) set_mac_byte(mac_pos, &total); -- cgit v1.2.1