nvmutil: fix modulo bias in mkstemp

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-18 04:45:53 +00:00
parent 8d467ecea9
commit 4810284f12

View File

@@ -2908,7 +2908,7 @@ x_i_mkstemp(char *template)
for (j = 0; j < 6; j++) { for (j = 0; j < 6; j++) {
r = rlong(); 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); fd = open(template, O_RDWR | O_CREAT | O_EXCL, 0600);