From fbc4b11da543753b3b803e5546f56e26ec90c2a7 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Tue, 9 Apr 2024 21:11:02 +0200 Subject: Make sure to call isdigit and isspace with unsigned char Casting to Int32 or int could create negative values. Which isspace and isdigit don't handle. SEI CERT C Coding Standard STR37-C. Resolve by casting to UChar or unsigned char instead of Int32 or int. https://sourceware.org/bugzilla/show_bug.cgi?id=28283 --- bzlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bzlib.c') diff --git a/bzlib.c b/bzlib.c index 2178655..100873c 100644 --- a/bzlib.c +++ b/bzlib.c @@ -1408,7 +1408,7 @@ BZFILE * bzopen_or_bzdopen case 's': smallMode = 1; break; default: - if (isdigit((int)(*mode))) { + if (isdigit((unsigned char)(*mode))) { blockSize100k = *mode-BZ_HDR_0; } } -- cgit v1.2.3-55-g6feb