From: Fabian Keil Date: Fri, 13 Mar 2009 14:10:07 +0000 (+0000) Subject: Fix some more harmless warnings on amd64. X-Git-Tag: v_3_0_12~28 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=1bd4869ad6285c7d6d1825e0b395c32a132f5499 Fix some more harmless warnings on amd64. --- diff --git a/jcc.c b/jcc.c index 4095e3c0..6d2224d3 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.231 2009/03/08 14:19:23 fabiankeil Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.232 2009/03/08 19:29:16 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jcc.c,v $ @@ -33,6 +33,11 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.231 2009/03/08 14:19:23 fabiankeil Exp $" * * Revisions : * $Log: jcc.c,v $ + * Revision 1.232 2009/03/08 19:29:16 fabiankeil + * Reinitialize the timeout structure every time before passing + * it to select(). Apparently some implementations mess with it. + * Probably fixes #2669131 reported by cyberpatrol. + * * Revision 1.231 2009/03/08 14:19:23 fabiankeil * Fix justified (but harmless) compiler warnings * on platforms where sizeof(int) < sizeof(long). @@ -2590,7 +2595,7 @@ static void chat(struct client_state *csp) int max_forwarded_connect_retries = csp->config->forwarded_connect_retries; const struct forward_spec *fwd; struct http_request *http; - int len = 0; /* for buffer sizes (and negative error codes) */ + long len = 0; /* for buffer sizes (and negative error codes) */ /* Function that does the content filtering for the current request */ filter_function_ptr content_filter = NULL; @@ -3064,7 +3069,7 @@ static void chat(struct client_state *csp) if (add_to_iob(csp, buf, len)) { size_t hdrlen; - int flushed; + long flushed; log_error(LOG_LEVEL_INFO, "Flushing header and buffers. Stepping back from filtering."); diff --git a/parsers.c b/parsers.c index 937c7a4d..cfe9307f 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.152 2009/03/01 18:43:48 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.153 2009/03/07 13:09:17 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -44,6 +44,12 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.152 2009/03/01 18:43:48 fabiankei * * Revisions : * $Log: parsers.c,v $ + * Revision 1.153 2009/03/07 13:09:17 fabiankeil + * Change csp->expected_content and_csp->expected_content_length from + * size_t to unsigned long long to reduce the likelihood of integer + * overflows that would let us close the connection prematurely. + * Bug found while investigating #2669131, reported by cyberpatrol. + * * Revision 1.152 2009/03/01 18:43:48 fabiankeil * Help clang understand that we aren't dereferencing * NULL pointers here. @@ -1083,9 +1089,9 @@ static const add_header_func_ptr add_server_headers[] = { * file, the results are not portable. * *********************************************************************/ -int flush_socket(jb_socket fd, struct iob *iob) +long flush_socket(jb_socket fd, struct iob *iob) { - int len = iob->eod - iob->cur; + long len = iob->eod - iob->cur; if (len <= 0) { @@ -1118,7 +1124,7 @@ int flush_socket(jb_socket fd, struct iob *iob) * or buffer limit reached. * *********************************************************************/ -jb_err add_to_iob(struct client_state *csp, char *buf, int n) +jb_err add_to_iob(struct client_state *csp, char *buf, long n) { struct iob *iob = csp->iob; size_t used, offset, need, want; diff --git a/parsers.h b/parsers.h index 7e77678e..e3061782 100644 --- a/parsers.h +++ b/parsers.h @@ -1,6 +1,6 @@ #ifndef PARSERS_H_INCLUDED #define PARSERS_H_INCLUDED -#define PARSERS_H_VERSION "$Id: parsers.h,v 1.47 2008/05/21 20:12:11 fabiankeil Exp $" +#define PARSERS_H_VERSION "$Id: parsers.h,v 1.48 2008/05/30 15:57:23 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $ @@ -43,6 +43,9 @@ * * Revisions : * $Log: parsers.h,v $ + * Revision 1.48 2008/05/30 15:57:23 fabiankeil + * Remove now-useless reference to debug. + * * Revision 1.47 2008/05/21 20:12:11 fabiankeil * The whole point of strclean() is to modify the * first parameter, so don't mark it immutable, @@ -286,8 +289,8 @@ extern "C" { #define FILTER_CLIENT_HEADERS 0 #define FILTER_SERVER_HEADERS 1 -extern int flush_socket(jb_socket fd, struct iob *iob); -extern jb_err add_to_iob(struct client_state *csp, char *buf, int n); +extern long flush_socket(jb_socket fd, struct iob *iob); +extern jb_err add_to_iob(struct client_state *csp, char *buf, long n); extern jb_err decompress_iob(struct client_state *csp); extern char *get_header(struct iob *iob); extern char *get_header_value(const struct list *header_list, const char *header_name);