diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-03 23:17:02 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-03 23:17:02 +0000 |
| commit | 790009f58ea8ebacfd3a66b936240cd19c27a42e (patch) | |
| tree | 857eb06a583a377250f4918f9e8291e1bf50f580 | |
| parent | 7b15b020b573cd98da074a72deb2e57b5a8618e3 (diff) | |
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>
| -rw-r--r-- | util/nvmutil/nvmutil.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |
