Skip empty filter files in pcrs_filter_response,
authorFabian Keil <fk@fabiankeil.de>
Fri, 22 Dec 2006 14:24:52 +0000 (14:24 +0000)
committerFabian Keil <fk@fabiankeil.de>
Fri, 22 Dec 2006 14:24:52 +0000 (14:24 +0000)
but don't ignore the ones that come afterwards.
Fixes parts of BR 1619208.

filters.c

index 1300a7e..831fcb0 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.69 2006/12/08 12:39:13 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.70 2006/12/09 13:33:15 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -40,6 +40,10 @@ const char filters_rcs[] = "$Id: filters.c,v 1.69 2006/12/08 12:39:13 fabiankeil
  *
  * Revisions   :
  *    $Log: filters.c,v $
+ *    Revision 1.70  2006/12/09 13:33:15  fabiankeil
+ *    Added some sanity checks for get_last_url().
+ *    Fixed possible segfault caused by my last commit.
+ *
  *    Revision 1.69  2006/12/08 12:39:13  fabiankeil
  *    Let get_last_url() catch https URLs as well.
  *
@@ -1694,7 +1698,18 @@ char *pcrs_filter_response(struct client_state *csp)
    {
      fl = csp->rlist[i];
      if ((NULL == fl) || (NULL == fl->f))
-       break;
+     {
+        /*
+         * Either there are no filter files
+         * left, or this filter file just
+         * contains no valid filters.
+         *
+         * Continue to be sure we don't miss
+         * valid filter files that are chained
+         * after empty or invalid ones.
+         */
+        continue;
+     }
    /*
     * For all applying +filter actions, look if a filter by that
     * name exists and if yes, execute it's pcrs_joblist on the