diff options
author | Rich Felker <dalias@aerifal.cx> | 2014-09-05 14:01:13 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-03-30 01:15:44 -0400 |
commit | 5a8c6f09327f7dd4d0d02f7ffeaaf9137d119c30 (patch) | |
tree | 0c770a9d25aa3796a386037e8a75fad8f4de87b0 /src | |
parent | f071365e66174937ffcb68c103e68573ce7dfd13 (diff) | |
download | musl-5a8c6f09327f7dd4d0d02f7ffeaaf9137d119c30.tar.gz musl-5a8c6f09327f7dd4d0d02f7ffeaaf9137d119c30.tar.bz2 musl-5a8c6f09327f7dd4d0d02f7ffeaaf9137d119c30.tar.xz musl-5a8c6f09327f7dd4d0d02f7ffeaaf9137d119c30.zip |
fix off-by-one in bounds check in fpathconf
this error resulted in an out-of-bounds read, as opposed to a reported
error, when calling the function with an argument one greater than the
max valid index.
(cherry picked from commit 3bed89aa7456d9fe30e550cb5e21f8911036695b)
Diffstat (limited to 'src')
-rw-r--r-- | src/conf/fpathconf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/conf/fpathconf.c b/src/conf/fpathconf.c index 28c4345c..8eb037e6 100644 --- a/src/conf/fpathconf.c +++ b/src/conf/fpathconf.c @@ -27,7 +27,7 @@ long fpathconf(int fd, int name) [_PC_SYMLINK_MAX] = SYMLINK_MAX, [_PC_2_SYMLINKS] = 1 }; - if (name > sizeof(values)/sizeof(values[0])) { + if (name >= sizeof(values)/sizeof(values[0])) { errno = EINVAL; return -1; } |