The prog parameter from ExecRE() is first dereferenced and than checked for
NULL. Swap this.

Bert

---

 source/regularExp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --quilt old/source/regularExp.c new/source/regularExp.c
--- old/source/regularExp.c
+++ new/source/regularExp.c
@@ -2703,13 +2703,10 @@ int ExecRE(regexp *prog, const char* str
             unsigned char **e_ptr;
                      int    ret_val = 0;
             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) {
       reg_error ("NULL parameter to `ExecRE\'");
       goto SINGLE_RETURN;
@@ -2720,10 +2717,13 @@ int ExecRE(regexp *prog, const char* str
    if (U_CHAR_AT (prog->program) != MAGIC) {
       reg_error ("corrupted program");
       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) {
       Current_Delimiters = Default_Delimiters;
    } else {
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to