From: Fabian Keil Date: Wed, 25 May 2016 10:50:28 +0000 (+0000) Subject: pcrs_compile_replacement(): Add two assertions X-Git-Tag: v_3_0_25~14 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=239c9fc5994c5c76927733bf383bbdb8072e8d2a;hp=797ddff0b98384c2033537b283c9e6e43fba8df3 pcrs_compile_replacement(): Add two assertions --- diff --git a/pcrs.c b/pcrs.c index 93f58278..955ccf8b 100644 --- a/pcrs.c +++ b/pcrs.c @@ -1,4 +1,4 @@ -const char pcrs_rcs[] = "$Id: pcrs.c,v 1.48 2015/12/27 12:45:46 fabiankeil Exp $"; +const char pcrs_rcs[] = "$Id: pcrs.c,v 1.49 2016/05/08 10:45:51 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/pcrs.c,v $ @@ -375,6 +375,8 @@ 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]) && (r->backref[l] < PCRS_MAX_SUBMATCHES + 2) &&