瀏覽代碼

fix off-by-one array bound in strsignal

Rich Felker 11 年之前
父節點
當前提交
8599822ee1
共有 1 個文件被更改,包括 1 次插入1 次删除
  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