From: Fabian Keil <fk@fabiankeil.de>
Date: Sat, 12 Aug 2017 09:40:50 +0000 (+0000)
Subject: pcrs_compile_replacement(): Remove an assertion that could be triggered with invalid... 
X-Git-Tag: v_3_0_27~88
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/@default-cgi@/coding.html?a=commitdiff_plain;h=2380f2ad52748713f50ffb0ab10613204a58accd;p=privoxy.git

pcrs_compile_replacement(): Remove an assertion that could be triggered with invalid input

Without the assertion the invalid input is properly rejected:
Error: Failed to compile pcrs replacement. Error: (pcrs:) Backreference out of range

This reverts one half of r1.50 which apparently wasn't
properly tested.
---

diff --git a/pcrs.c b/pcrs.c
index ebcfb360..8a09d394 100644
--- a/pcrs.c
+++ b/pcrs.c
@@ -1,4 +1,4 @@
-const char pcrs_rcs[] = "$Id: pcrs.c,v 1.51 2016/12/24 16:00:49 fabiankeil Exp $";
+const char pcrs_rcs[] = "$Id: pcrs.c,v 1.52 2017/05/29 10:09:37 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/pcrs.c,v $
@@ -410,7 +410,6 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr
                goto plainchar;
             }
 
-            assert(l < PCRS_MAX_SUBMATCHES - 1);
             assert(r->backref[l] < PCRS_MAX_SUBMATCHES + 2);
             /* Valid and in range? -> record */
             if ((0 <= r->backref[l]) &&