diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-11-20 21:53:40 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-11-20 21:53:40 +0000 |
commit | 7371a8ec3363b088abafe7db1f837086f36e87f2 (patch) | |
tree | f214b5a4ffb52df23566414ded3f9811ec680dd1 | |
parent | 018a31ed49caea5de8ea520dfe557d484d04edd6 (diff) |
Compute user-given ulimit value times ulimit unit as an rlim_t value, not a
long value; catches some 32 bit overflows on 32 bit platforms.
Found by drahn@, ok otto@
-rw-r--r-- | bin/ksh/c_ulimit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ksh/c_ulimit.c b/bin/ksh/c_ulimit.c index d955303800e..8c81dc14d83 100644 --- a/bin/ksh/c_ulimit.c +++ b/bin/ksh/c_ulimit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_ulimit.c,v 1.15 2006/03/12 00:26:58 deraadt Exp $ */ +/* $OpenBSD: c_ulimit.c,v 1.16 2006/11/20 21:53:39 miod Exp $ */ /* ulimit -- handle "ulimit" builtin @@ -118,7 +118,7 @@ c_ulimit(char **wp) bi_errorf("invalid limit: %s", wp[0]); return 1; } - val = rval * l->factor; + val = (rlim_t)rval * l->factor; } } if (all) { |