[Pcre-svn] [1125] code/trunk: Give error for zero timing arg…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1125] code/trunk: Give error for zero timing argument to pcre2test.
Revision: 1125
          http://www.exim.org/viewvc/pcre2?view=rev&revision=1125
Author:   ph10
Date:     2019-07-03 18:15:37 +0100 (Wed, 03 Jul 2019)
Log Message:
-----------
Give error for zero timing argument to pcre2test.


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


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2019-06-28 16:58:08 UTC (rev 1124)
+++ code/trunk/ChangeLog    2019-07-03 17:15:37 UTC (rev 1125)
@@ -83,7 +83,9 @@
 if the end of the subject was encountered in a lookahead (conditional or
 otherwise), an atomic group, or a recursion.


+16. Give error if pcre2test -t, -T, -tm or -TM is given an argument of zero.

+
Version 10.33 16-April-2019
---------------------------


Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c    2019-06-28 16:58:08 UTC (rev 1124)
+++ code/trunk/src/pcre2test.c    2019-07-03 17:15:37 UTC (rev 1125)
@@ -3269,6 +3269,11 @@




+/* This function is no longer used. Keep it around for a while, just in case it 
+needs to be re-instated. */
+
+#ifdef NEVERNEVERNEVER
+
 /*************************************************
 *         Move back by so many characters        *
 *************************************************/
@@ -3313,6 +3318,7 @@
   return pp - (PCRE2_SPTR16)subject;
   }
 }
+#endif  /* NEVERNEVERNEVER */




@@ -8652,6 +8658,11 @@
     showtotaltimes = arg[1] == 'T';
     if (argc > 2 && (uli = strtoul(argv[op+1], &endptr, 10), *endptr == 0))
       {
+      if (uli == 0)
+        {
+        fprintf(stderr, "** Argument for %s must not be zero\n", arg);
+        exit(1);
+        }    
       if (U32OVERFLOW(uli))
         {
         fprintf(stderr, "** Argument for %s is too big\n", arg);