Explorar el Código

fix off-by-one array bound in strsignal

Rich Felker hace 11 años
padre
commit
8599822ee1
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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