[Pcre-svn] [1000] code/trunk: Fix small bug in pcre2grep ( n…

Inizio della pagina
Delete this message
Autore: Subversion repository
Data:  
To: pcre-svn
Oggetto: [Pcre-svn] [1000] code/trunk: Fix small bug in pcre2grep ( no effect other than a sanitizer warning).
Revision: 1000
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1000
Author:   ph10
Date:     2018-09-10 18:34:19 +0100 (Mon, 10 Sep 2018)
Log Message:
-----------
Fix small bug in pcre2grep (no effect other than a sanitizer warning).


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2grep.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2018-09-07 15:56:36 UTC (rev 999)
+++ code/trunk/ChangeLog    2018-09-10 17:34:19 UTC (rev 1000)
@@ -2,8 +2,8 @@
 --------------------



-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,7 +189,15 @@
(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
------------------------------


Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c    2018-09-07 15:56:36 UTC (rev 999)
+++ code/trunk/src/pcre2grep.c    2018-09-10 17:34:19 UTC (rev 1000)
@@ -2364,7 +2364,7 @@
 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;