projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
633183b
)
fix off-by-one in bounds check in fpathconf
author
Rich Felker
<dalias@aerifal.cx>
Fri, 5 Sep 2014 18:01:13 +0000
(14:01 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 5 Sep 2014 18:01:13 +0000
(14:01 -0400)
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.
src/conf/fpathconf.c
patch
|
blob
|
history
diff --git
a/src/conf/fpathconf.c
b/src/conf/fpathconf.c
index
28c4345
..
8eb037e
100644
(file)
--- 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;
}