summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-12-11 18:32:05 +0000
committered <ed@FreeBSD.org>2008-12-11 18:32:05 +0000
commit965f53efcf29a0db7b2ceacd11e21f19a7e47fff (patch)
tree3c3401c5712565194049deabfcd0555db8a3e0d7
parent1b2020cf1789970ca4e39393b8b7e20cf594db80 (diff)
downloadFreeBSD-src-965f53efcf29a0db7b2ceacd11e21f19a7e47fff.zip
FreeBSD-src-965f53efcf29a0db7b2ceacd11e21f19a7e47fff.tar.gz
Don't forget to add "npts" to rlimit_ident[] as well.
When I added RLIMIT_NPTS, I forgot to add it to rlimit_ident[]. Make sure the rlimit_ident[] array is always RLIM_NLIMITS elements big. So if we ever forget to add new rlimits to this list again. it will contain a null pointer, instead of random data. Spotted by: rwatson
-rw-r--r--sys/sys/resource.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/resource.h b/sys/sys/resource.h
index 03fbd70..6f2c6f9 100644
--- a/sys/sys/resource.h
+++ b/sys/sys/resource.h
@@ -106,7 +106,7 @@ struct rusage {
*/
#ifdef _RLIMIT_IDENT
-static char *rlimit_ident[] = {
+static char *rlimit_ident[RLIM_NLIMITS] = {
"cpu",
"fsize",
"data",
@@ -118,6 +118,7 @@ static char *rlimit_ident[] = {
"nofile",
"sbsize",
"vmem",
+ "npts",
};
#endif
OpenPOWER on IntegriCloud