projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Synced with stable branch:
[privoxy.git]
/
src
/
filters.c
diff --git
a/src/filters.c
b/src/filters.c
index
60f47e9
..
3c7265b
100644
(file)
--- a/
src/filters.c
+++ b/
src/filters.c
@@
-1,7
+1,7
@@
-const char filters_rcs[] = "$Id: filters.c,v
1.58 2002/04/24 02:11:17 oe
s Exp $";
+const char filters_rcs[] = "$Id: filters.c,v
2.1 2002/08/26 11:08:18 saranti
s Exp $";
/*********************************************************************
*
/*********************************************************************
*
- * File : $Source: /cvsroot/ijbswa/
current
/filters.c,v $
+ * File : $Source: /cvsroot/ijbswa/
/current/src
/filters.c,v $
*
* Purpose : Declares functions to parse/crunch headers and pages.
* Functions declared include:
*
* Purpose : Declares functions to parse/crunch headers and pages.
* Functions declared include:
@@
-38,6
+38,12
@@
const char filters_rcs[] = "$Id: filters.c,v 1.58 2002/04/24 02:11:17 oes Exp $"
*
* Revisions :
* $Log: filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 2.1 2002/08/26 11:08:18 sarantis
+ * Fix typo.
+ *
+ * Revision 2.0 2002/06/04 14:34:21 jongfoster
+ * Moving source files to src/
+ *
* Revision 1.58 2002/04/24 02:11:17 oes
* Jon's multiple AF patch: url_actions now evaluates rules
* from all AFs.
* Revision 1.58 2002/04/24 02:11:17 oes
* Jon's multiple AF patch: url_actions now evaluates rules
* from all AFs.
@@
-215,7
+221,7
@@
const char filters_rcs[] = "$Id: filters.c,v 1.58 2002/04/24 02:11:17 oes Exp $"
* generic content modification interface of pcrs_filter_response
* and acts as a wrapper to deanimate.c:gif_deanimate()
* - Renamed re_process_buffer to pcrs_filter_response
* generic content modification interface of pcrs_filter_response
* and acts as a wrapper to deanimate.c:gif_deanimate()
* - Renamed re_process_buffer to pcrs_filter_response
- * - pcrs_filter_response now returns NULL on fail
i
ure
+ * - pcrs_filter_response now returns NULL on failure
* - Removed all #ifdef PCRS
*
* Revision 1.20 2001/07/01 17:01:04 oes
* - Removed all #ifdef PCRS
*
* Revision 1.20 2001/07/01 17:01:04 oes
@@
-1078,8
+1084,9
@@
struct http_response *redirect_url(struct client_state *csp)
*
* Description : Given a URL, decide whether it is an image or not,
* using either the info from a previous +image action
*
* Description : Given a URL, decide whether it is an image or not,
* using either the info from a previous +image action
- * or, #ifdef FEATURE_IMAGE_DETECT_MSIE, the info from
- * the browser's accept header.
+ * or, #ifdef FEATURE_IMAGE_DETECT_MSIE, and the browser
+ * is MSIE and not on a Mac, tell from the browser's accept
+ * header.
*
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
*
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
@@
-1094,7
+1101,7
@@
int is_imageurl(struct client_state *csp)
char *tmp;
tmp = get_header_value(csp->headers, "User-Agent:");
char *tmp;
tmp = get_header_value(csp->headers, "User-Agent:");
- if (tmp && strstr(tmp, "MSIE"))
+ if (tmp && strstr(tmp, "MSIE")
&& !strstr(tmp, "Mac_")
)
{
tmp = get_header_value(csp->headers, "Accept:");
if (tmp && strstr(tmp, "image/gif"))
{
tmp = get_header_value(csp->headers, "Accept:");
if (tmp && strstr(tmp, "image/gif"))
@@
-1315,7
+1322,7
@@
char *pcrs_filter_response(struct client_state *csp)
if ( NULL == b->joblist )
{
log_error(LOG_LEVEL_RE_FILTER, "Filter %s has empty joblist. Nothing to do.", b->name);
if ( NULL == b->joblist )
{
log_error(LOG_LEVEL_RE_FILTER, "Filter %s has empty joblist. Nothing to do.", b->name);
-
return(NULL)
;
+
continue
;
}
log_error(LOG_LEVEL_RE_FILTER, "re_filtering %s%s (size %d) with filter %s...",
}
log_error(LOG_LEVEL_RE_FILTER, "re_filtering %s%s (size %d) with filter %s...",
@@
-1466,7
+1473,12
@@
int remove_chunked_transfer_coding(char *buffer, const size_t size)
log_error(LOG_LEVEL_ERROR, "Parse error while stripping \"chunked\" transfer coding");
return(0);
}
log_error(LOG_LEVEL_ERROR, "Parse error while stripping \"chunked\" transfer coding");
return(0);
}
- newsize += chunksize;
+
+ if ((newsize += chunksize) >= size)
+ {
+ log_error(LOG_LEVEL_ERROR, "Chunksize exceeds buffer in \"chunked\" transfer coding");
+ return(0);
+ }
from_p += 2;
memmove(to_p, from_p, (size_t) chunksize);
from_p += 2;
memmove(to_p, from_p, (size_t) chunksize);