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 <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-03 23:17:02 +00:00
parent 7b15b020b5
commit 790009f58e
+2
View File
@@ -285,6 +285,8 @@ parse_mac_string(void)
if (strnlen(mac, 20) != 17) if (strnlen(mac, 20) != 17)
err(EINVAL, "Invalid MAC address string length"); err(EINVAL, "Invalid MAC address string length");
(void) memset(macbuf, 0, sizeof(macbuf));
for (mac_pos = 0; mac_pos < 16; mac_pos += 3) for (mac_pos = 0; mac_pos < 16; mac_pos += 3)
set_mac_byte(mac_pos, &total); set_mac_byte(mac_pos, &total);