Mark *csp as immutable for is_untrusted_url()
authorFabian Keil <fk@fabiankeil.de>
Fri, 12 Jan 2007 15:36:44 +0000 (15:36 +0000)
committerFabian Keil <fk@fabiankeil.de>
Fri, 12 Jan 2007 15:36:44 +0000 (15:36 +0000)
and is_imageurl(). Closes FR 1237736.

AUTHORS
filters.c
filters.h

diff --git a/AUTHORS b/AUTHORS
index c3d05d7..10873a6 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -48,6 +48,7 @@ alphabetical order):
  Mattes Dolak 
  Peter E
  Florian Effenberger
+ Markus Elfring
  Dean Gaudet
  Daniel Griscom
  Felix Gröbert
index e69952e..36eccf4 100644 (file)
--- a/filters.c
+++ b/filters.c
@@ -1,4 +1,4 @@
-const char filters_rcs[] = "$Id: filters.c,v 1.75 2006/12/29 18:30:46 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.76 2007/01/01 19:36:37 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.c,v $
@@ -40,6 +40,10 @@ const char filters_rcs[] = "$Id: filters.c,v 1.75 2006/12/29 18:30:46 fabiankeil
  *
  * Revisions   :
  *    $Log: filters.c,v $
+ *    Revision 1.76  2007/01/01 19:36:37  fabiankeil
+ *    Integrate a modified version of Wil Mahan's
+ *    zlib patch (PR #895531).
+ *
  *    Revision 1.75  2006/12/29 18:30:46  fabiankeil
  *    Fixed gcc43 conversion warnings,
  *    changed sprintf calls to snprintf.
@@ -1425,7 +1429,7 @@ struct http_response *redirect_url(struct client_state *csp)
        * If it exists, use the previously rewritten URL as input
        * otherwise just use the old path.
        */
-      old_url = new_url ? new_url : strdup(csp->http->path);
+      old_url = (new_url != NULL) ? new_url : strdup(csp->http->path);
       new_url = get_last_url(old_url, redirect_mode);
       freez(old_url);
    }
@@ -1487,7 +1491,7 @@ struct http_response *redirect_url(struct client_state *csp)
  *                otherwise
  *
  *********************************************************************/
-int is_imageurl(struct client_state *csp)
+int is_imageurl(const struct client_state *csp)
 {
 #ifdef FEATURE_IMAGE_DETECT_MSIE
    char *tmp;
@@ -1534,7 +1538,7 @@ int is_imageurl(struct client_state *csp)
  * Returns     :  0 => trusted, 1 => untrusted
  *
  *********************************************************************/
-int is_untrusted_url(struct client_state *csp)
+int is_untrusted_url(const struct client_state *csp)
 {
    struct file_list *fl;
    struct block_spec *b;
index be27370..702d99f 100644 (file)
--- a/filters.h
+++ b/filters.h
@@ -1,6 +1,6 @@
 #ifndef FILTERS_H_INCLUDED
 #define FILTERS_H_INCLUDED
-#define FILTERS_H_VERSION "$Id: filters.h,v 1.23 2006/11/28 15:19:43 fabiankeil Exp $"
+#define FILTERS_H_VERSION "$Id: filters.h,v 1.24 2006/12/29 18:30:46 fabiankeil Exp $"
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/filters.h,v $
  *
  * Revisions   :
  *    $Log: filters.h,v $
+ *    Revision 1.24  2006/12/29 18:30:46  fabiankeil
+ *    Fixed gcc43 conversion warnings,
+ *    changed sprintf calls to snprintf.
+ *
  *    Revision 1.23  2006/11/28 15:19:43  fabiankeil
  *    Implemented +redirect{s@foo@bar@} to generate
  *    a redirect based on a rewritten version of the
@@ -256,10 +260,10 @@ extern struct http_response *trust_url(struct client_state *csp);
  * Request inspectors
  */
 #ifdef FEATURE_TRUST
-extern int is_untrusted_url(struct client_state *csp);
+extern int is_untrusted_url(const struct client_state *csp);
 #endif /* def FEATURE_TRUST */
 #ifdef FEATURE_IMAGE_BLOCKING
-extern int is_imageurl(struct client_state *csp);
+extern int is_imageurl(const struct client_state *csp);
 #endif /* def FEATURE_IMAGE_BLOCKING */
 
 /*