aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/_strerror.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/_strerror.c')
-rw-r--r--sysdeps/generic/_strerror.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/generic/_strerror.c b/sysdeps/generic/_strerror.c
index 53ff9343e1..4a9b032c86 100644
--- a/sysdeps/generic/_strerror.c
+++ b/sysdeps/generic/_strerror.c
@@ -40,7 +40,7 @@
char *
__strerror_r (int errnum, char *buf, size_t buflen)
{
- if (errnum < 0 || errnum >= _sys_nerr)
+ if (errnum < 0 || errnum >= _sys_nerr || _sys_errlist[errnum] == NULL)
{
/* Buffer we use to print the number in. For a maximum size for
`int' of 8 bytes we never need more than 20 digits. */