summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2018-09-10 17:34:19 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2018-09-10 17:34:19 +0000
commit0358954d7a1de6a6f0bba4a6b231e9161c19c96b (patch)
tree627cec33afabc0c0955a0eed540367fd2a9492e9
parentcf734e637c0149fad0a16c91a9db37eac53ef59d (diff)
downloadpcre2-0358954d7a1de6a6f0bba4a6b231e9161c19c96b.tar.gz
Fix small bug in pcre2grep (no effect other than a sanitizer warning).
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1000 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog12
-rw-r--r--src/pcre2grep.c2
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9394aaf..3f92e6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,8 @@ Change Log for PCRE2
--------------------
-Version 10.32-RC1 13-August-2018
---------------------------------
+Version 10.32-RC1 10-September-2018
+-----------------------------------
1. When matching using the the REG_STARTEND feature of the POSIX API with a
non-zero starting offset, unset capturing groups with lower numbers than a
@@ -189,6 +189,14 @@ pattern, but the behaviour is now consistent.
(for an event that could never occur but you had to have external information
to know that).
+42. If before the first match in a file that was being searched by pcre2grep
+there was a line that was sufficiently long to cause the input buffer to be
+expanded, the variable holding the location of the end of the previous match
+was being adjusted incorrectly, and could cause an overflow warning from a code
+sanitizer. However, as the value is used only to print pending "after" lines
+when the next match is reached (and there are no such lines in this case) this
+bug could do no damage.
+
Version 10.31 12-February-2018
------------------------------
diff --git a/src/pcre2grep.c b/src/pcre2grep.c
index 6c7c2a7..d5f34c8 100644
--- a/src/pcre2grep.c
+++ b/src/pcre2grep.c
@@ -2364,7 +2364,7 @@ int filepos = 0;
unsigned long int linenumber = 1;
unsigned long int lastmatchnumber = 0;
unsigned long int count = 0;
-char *lastmatchrestart = NULL;
+char *lastmatchrestart = main_buffer;
char *ptr = main_buffer;
char *endptr;
PCRE2_SIZE bufflength;