diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2015-11-29 17:38:25 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2015-11-29 17:38:25 +0000 |
commit | 108377b836fc29a84f5286287629d96549b1c777 (patch) | |
tree | 2edc0d6b73f692242dde327e17af9da0ad3f34f4 | |
parent | bfc1dfa660c24dc7a75108d934290e50d7db2719 (diff) | |
download | pcre-108377b836fc29a84f5286287629d96549b1c777.tar.gz |
Give error for regexec with pmatch=NULL and REG_STARTEND set.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1614 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | pcreposix.c | 1 |
2 files changed, 4 insertions, 0 deletions
@@ -17,6 +17,9 @@ Version 8.39 xx-xxxxxx-201x 3. Further to 8.38/46, negated classes such as [^[:^ascii:]\d] were also not working correctly in UCP mode. + +4. The POSIX wrapper function regexec() crashed if the option REG_STARTEND + was set when the pmatch argument was NULL. It now returns REG_INVARG. Version 8.38 23-November-2015 diff --git a/pcreposix.c b/pcreposix.c index f024423..dcc13ef 100644 --- a/pcreposix.c +++ b/pcreposix.c @@ -364,6 +364,7 @@ start location rather than being passed as a PCRE "starting offset". */ if ((eflags & REG_STARTEND) != 0) { + if (pmatch == NULL) return REG_INVARG; so = pmatch[0].rm_so; eo = pmatch[0].rm_eo; } |