Skip to content

Commit ab4edcd

Browse files
ebblakeemaste
authored andcommitted
m4: Fix OOB access displaying MIN_INT
Previously displaying INT_MIN resulted in an out of bounds access to digits[-8]. In twos-complement -INT_MIN is still negative. PR: 287013 Reviewed by: emaste
1 parent ac196a5 commit ab4edcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

usr.bin/m4/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void
121121
pbnumbase(int n, int base, int d)
122122
{
123123
static char digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
124-
int num;
124+
unsigned int num;
125125
int printed = 0;
126126

127127
if (base > 36)

0 commit comments

Comments
 (0)