diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2018-04-09 00:42:15 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2018-04-09 00:42:15 +0200 |
commit | fe36c1ada77f817dbeeeed5ee70c7ba08eeb1d18 (patch) | |
tree | 0229967da5e73bd29a2d6014c847509b361f3631 /Src/utils.c | |
parent | 1521c7d0f7e607b789564e819173e228e9475137 (diff) | |
parent | f9e9dce5443f323b340303596406f9d3ce11d23a (diff) | |
download | zsh-fe36c1ada77f817dbeeeed5ee70c7ba08eeb1d18.tar.gz zsh-fe36c1ada77f817dbeeeed5ee70c7ba08eeb1d18.zip |
Merge tag 'zsh-5.5' and hence branch 'upstream' into branch 'debian'
Release 5.5 of zsh
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Src/utils.c b/Src/utils.c index 3587c3622..180693d67 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -1653,7 +1653,7 @@ checkmailpath(char **s) LinkList l; DIR *lock = opendir(unmeta(*s)); char buf[PATH_MAX * 2 + 1], **arr, **ap; - int ct = 1; + int buflen, ct = 1; if (lock) { char *fn; @@ -1662,9 +1662,11 @@ checkmailpath(char **s) l = newlinklist(); while ((fn = zreaddir(lock, 1)) && !errflag) { if (u) - sprintf(buf, "%s/%s?%s", *s, fn, u); + buflen = snprintf(buf, sizeof(buf), "%s/%s?%s", *s, fn, u); else - sprintf(buf, "%s/%s", *s, fn); + buflen = snprintf(buf, sizeof(buf), "%s/%s", *s, fn); + if (buflen < 0 || buflen >= (int)sizeof(buf)) + continue; addlinknode(l, dupstring(buf)); ct++; } @@ -2486,9 +2488,7 @@ zstrtoul_underscore(const char *s, zulong *retval) base = 2, s++; else base = isset(OCTALZEROES) ? 8 : 10; - if (base < 2 || base > 36) { - return 0; - } else if (base <= 10) { + if (base <= 10) { for (; (*s >= '0' && *s < ('0' + base)) || *s == '_'; s++) { if (*s == '_') |