Procházet zdrojové kódy

fix off-by-one array bound in strsignal

Rich Felker před 11 roky
rodič
revize
8599822ee1
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/string/strsignal.c

+ 1 - 1
src/string/strsignal.c

@@ -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