diff options
author | Eduardo Chappa <chappa@washington.edu> | 2015-03-25 20:27:02 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2015-03-25 20:27:02 -0600 |
commit | 3a9d4c01e5135f6d5b2aecdaf698d1d960387df9 (patch) | |
tree | 01b45596b7334d2f9d1298f099ca4f037f2e69b7 /regex | |
parent | 955a543f9ac3bb29b88a42d0520ac68324c2f6fa (diff) | |
download | alpine-3a9d4c01e5135f6d5b2aecdaf698d1d960387df9.tar.xz |
* new version 2.20.4
* If the charset of a message can not be determined, use the value set
in the "Unknown Character Set" option.
* Resizing setup screen will redraw screen.
* Unix Alpine only. Experimental: If Alpine/Pico finds a UCS4 code
in the width ambiguous zone, it will use other means to determine
the width, such as call wcwidth.
Diffstat (limited to 'regex')
-rw-r--r-- | regex/regcomp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/regex/regcomp.c b/regex/regcomp.c index 0d083167..5072f7fa 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -212,7 +212,10 @@ regcomp(regex_t *preg, const char *pattern, int cflags) return(REG_ESPACE); } p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ - assert(p->ssize >= len); + if(p->ssize < len || p->ssize > LONG_MAX / sizeof(sop)){ + free((char *)g); + return REG_INVARG; + } p->strip = (sop *)malloc(p->ssize * sizeof(sop)); p->slen = 0; if (p->strip == NULL) { |