diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/Builtins/rlimits.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 627281417..8c7e158d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-10-22 Bart Schaefer <schaefer@zsh.org> + * 16111: Src/Builtins/rlimits.c: Report error on attempt to set + limit to a string that is not a decimal number. + * 16109: Src/init.c: Use a fixed initial fdtable_size to fix crash resulting from a huge memory allocation, as reported in 16082. diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c index f81ce2412..359e04ed0 100644 --- a/Src/Builtins/rlimits.c +++ b/Src/Builtins/rlimits.c @@ -332,7 +332,12 @@ bin_limit(char *nam, char **argv, char *ops, int func) } else if (limtype[lim] == ZLIMTYPE_NUMBER || limtype[lim] == ZLIMTYPE_UNKNOWN) { /* pure numeric resource -- only a straight decimal number is permitted. */ - val = zstrtorlimt(s, &s, 10); + char *t = s; + val = zstrtorlimt(t, &s, 10); + if (s == t) { + zwarnnam("limit", "limit must be a number", NULL, 0); + return 1; + } } else { /* memory-type resource -- `k' and `M' modifiers are permitted, meaning (respectively) 2^10 and 2^20. */ |