From 2380f2ad52748713f50ffb0ab10613204a58accd Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 12 Aug 2017 09:40:50 +0000 Subject: [PATCH] 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. --- pcrs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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]) && -- 2.39.2