projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c5d1adc
)
fix broken sysconf when correct value is -1
author
Rich Felker
<dalias@aerifal.cx>
Sat, 21 Apr 2012 15:45:07 +0000
(11:45 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Sat, 21 Apr 2012 15:45:07 +0000
(11:45 -0400)
this caused glib to try to allocate >2gb for getpwnam_r, and probably
numerous other problems.
src/conf/sysconf.c
patch
|
blob
|
history
diff --git
a/src/conf/sysconf.c
b/src/conf/sysconf.c
index 5b6c14e520f2c97e93bfc753e632cd6ae76221e9..07072ccfdba7209dd1424fcd8bec4786bd808269 100644
(file)
--- a/
src/conf/sysconf.c
+++ b/
src/conf/sysconf.c
@@
-220,7
+220,7
@@
long sysconf(int name)
} else if (values[name] == OFLOW) {
if (name == _SC_ARG_MAX) return ARG_MAX;
if (name == _SC_SEM_VALUE_MAX) return SEM_VALUE_MAX;
- } else if (values[name] <
0
) {
+ } else if (values[name] <
OFLOW
) {
long lim[2];
__syscall(SYS_getrlimit, values[name]&16383, lim);
return lim[0] < 0 ? LONG_MAX : lim[0];