Kaynağa Gözat

fix off-by-one array bound in strsignal

Rich Felker 11 yıl önce
ebeveyn
işleme
8599822ee1
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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