fix off-by-one array bound in strsignal
authorRich Felker <dalias@aerifal.cx>
Tue, 9 Jul 2013 06:11:52 +0000 (02:11 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 9 Jul 2013 06:11:52 +0000 (02:11 -0400)
src/string/strsignal.c

index 3b0ae6d7c7c16bfc2a59df60325d7dcd6b94b33d..d70982aa58a7962928e2d884a233ca0b2110a247 100644 (file)
@@ -48,7 +48,7 @@ static const char map[] = {
        [SIGSYS]    = 31
 };
 
-#define sigmap(x) ((unsigned)(x) > sizeof map ? 0 : map[(unsigned)(x)])
+#define sigmap(x) ((unsigned)(x) >= sizeof map ? 0 : map[(unsigned)(x)])
 
 #endif