From fe15424491224f04fb4674085953e53e66f70adf Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Fri, 29 Feb 2008 23:12:26 +0000 Subject: [PATCH] The prog parameter from ExecRE() is first dereferenced and than checked for NULL. Fix this. --- source/regularExp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/regularExp.c b/source/regularExp.c index 3bfaf64..12afade 100644 --- a/source/regularExp.c +++ b/source/regularExp.c @@ -1,4 +1,4 @@ -static const char CVSID[] = "$Id: regularExp.c,v 1.32 2008/01/04 22:11:04 yooden Exp $"; +static const char CVSID[] = "$Id: regularExp.c,v 1.33 2008/02/29 23:12:26 lebert Exp $"; /*------------------------------------------------------------------------* * `CompileRE', `ExecRE', and `substituteRE' -- regular expression parsing * @@ -2705,9 +2705,6 @@ int ExecRE(regexp *prog, const char* string, const char* end, int reverse, unsigned char tempDelimitTable [256]; int i; - s_ptr = (unsigned char **) prog->startp; - e_ptr = (unsigned char **) prog->endp; - /* Check for valid parameters. */ if (prog == NULL || string == NULL) { @@ -2722,6 +2719,9 @@ int ExecRE(regexp *prog, const char* string, const char* end, int reverse, goto SINGLE_RETURN; } + s_ptr = (unsigned char **) prog->startp; + e_ptr = (unsigned char **) prog->endp; + /* If caller has supplied delimiters, make a delimiter table */ if (delimiters == NULL) { -- 2.11.4.GIT