aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2025-05-24 17:21:38 +0000
committerEd Maste <emaste@FreeBSD.org>2025-05-30 12:45:56 +0000
commit75f7d9cbff26264640fcfcd2e3c5c4ca1d0ea0a6 (patch)
tree561a24b7c1503404be1eb1ea085fd33fe31175fd
parentd4f5d3a4eade118694a537564e35c64fdd779f9a (diff)
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 (cherry picked from commit ab4edcd552c967a400e85afc0fd3e6729fa9ee2c)
-rw-r--r--usr.bin/m4/misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c
index 4533e106a37f..73ced384466c 100644
--- a/usr.bin/m4/misc.c
+++ b/usr.bin/m4/misc.c
@@ -122,7 +122,7 @@ void
pbnumbase(int n, int base, int d)
{
static char digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
- int num;
+ unsigned int num;
int printed = 0;
if (base > 36)