summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-06 16:41:59 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-06 16:41:59 +0000
commita358a6fe09ab795d80580f7bd7d99f4266b11544 (patch)
tree7c23e2b95ec3074c8d73153bc05c021ed901a651 /util
parenta82c766b8cd34935278361af5d7858df53140dcc (diff)
util/nvmutil: use strlen instead of strnlen
strnlen isn't available on some older unices. we already know the string will be null-terminated, because it comes from argv, so runaway reads are extremely unlikely (read: impossible). Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 1da75d72..b727a539 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -359,7 +359,7 @@ parse_mac_string(void)
{
int mac_pos;
- if (strnlen(mac, 20) != 17)
+ if (strlen(mac) != 17)
err(EINVAL, "MAC address is the wrong length");
for (mac_pos = 0; mac_pos < 16; mac_pos += 3)