mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user