summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-18 04:45:53 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-18 04:45:53 +0000
commit4810284f12ca1ebf3b0cf2609d6f133385577731 (patch)
treecbc5ae1ec74589e986d2b6c03069a8011cb798d9 /util/nvmutil
parent8d467ecea99eb42dab3f6a8dcd888e8e623e2680 (diff)
nvmutil: fix modulo bias in mkstemp
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/nvmutil')
-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 34b6f38b..c34d79c3 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -2908,7 +2908,7 @@ x_i_mkstemp(char *template)
for (j = 0; j < 6; j++) {
r = rlong();
- p[j] = ch[r % (sizeof(ch) - 1)];
+ p[j] = ch[(unsigned long)(r >> 1) % (sizeof(ch) - 1)];
}
fd = open(template, O_RDWR | O_CREAT | O_EXCL, 0600);