X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=pcrs.c;h=29fb78d226beb53bc38d8913ae2b2d7ab630d216;hb=0740e2753c8fe409fcc2d70e06b4eb5bdb2b19cd;hp=52d7b9062f95a95a9cfb2567674486e56f49661a;hpb=aaeeb414357ff75414ed705302c4624f083bd512;p=privoxy.git diff --git a/pcrs.c b/pcrs.c index 52d7b906..29fb78d2 100644 --- a/pcrs.c +++ b/pcrs.c @@ -1,4 +1,4 @@ -const char pcrs_rcs[] = "$Id: pcrs.c,v 1.40 2012/03/09 17:55:50 fabiankeil Exp $"; +const char pcrs_rcs[] = "$Id: pcrs.c,v 1.44 2014/10/18 11:25:24 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/pcrs.c,v $ @@ -301,7 +301,7 @@ static pcrs_substitute *pcrs_compile_replacement(const char *replacement, int tr */ const int ascii_value = xtoi(&replacement[i+2]); - assert(ascii_value > 0); + assert(ascii_value >= 0); assert(ascii_value < 256); text[k++] = (char)ascii_value; i += 4; @@ -825,7 +825,7 @@ int pcrs_execute(pcrs_job *job, const char *subject, size_t subject_length, char else offset = offsets[1]; } - /* Pass pcre error through if (bad) failiure */ + /* Pass pcre error through if (bad) failure */ if (submatches < PCRE_ERROR_NOMATCH) { free(matches); @@ -997,8 +997,8 @@ char pcrs_get_delimiter(const char *string) * Some characters that are unlikely to * be part of pcrs replacement strings. */ - char delimiters[] = "><#+*~%^-:;!@"; - char *d = delimiters; + static const char delimiters[] = "><#+*~%^-:;!@"; + const char *d = delimiters; /* Take the first delimiter that isn't part of the string */ while (*d && NULL != strchr(string, *d)) @@ -1102,6 +1102,7 @@ pcrs_job *pcrs_compile_dynamic_command(char *pcrs_command, const struct pcrs_var { /* No proper delimiter found */ *error = PCRS_ERR_CMDSYNTAX; + freez(pcrs_command_tmp); return NULL; }