projects
/
privoxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix compiler warning from GCC9 with -D_FORTIFY_SOURCE=2
[privoxy.git]
/
parsers.c
diff --git
a/parsers.c
b/parsers.c
index
2b3a34f
..
eab5e76
100644
(file)
--- a/
parsers.c
+++ b/
parsers.c
@@
-3570,8
+3570,8
@@
static jb_err client_if_modified_since(struct client_state *csp, char **header)
}
else
{
}
else
{
- log_error(LOG_LEVEL_ERROR,
"Random range is 0. Assuming time transformation test.",
-
*header
);
+ log_error(LOG_LEVEL_ERROR,
+
"Random range is 0. Assuming time transformation test."
);
}
tm += rtime * (negative_range ? -1 : 1);
timeptr = privoxy_gmtime_r(&tm, &gmt);
}
tm += rtime * (negative_range ? -1 : 1);
timeptr = privoxy_gmtime_r(&tm, &gmt);
@@
-4067,7
+4067,8
@@
static jb_err server_http(struct client_state *csp, char **header)
return JB_ERR_PARSE;
}
return JB_ERR_PARSE;
}
- if (csp->http->status == 206)
+ if (csp->http->status == 101 ||
+ csp->http->status == 206)
{
csp->content_type = CT_TABOO;
}
{
csp->content_type = CT_TABOO;
}
@@
-4497,7
+4498,7
@@
static jb_err parse_header_time(const char *header_time, time_t *result)
if (*result != result2)
{
log_error(LOG_LEVEL_ERROR, "strftime() and strptime() disagree. "
if (*result != result2)
{
log_error(LOG_LEVEL_ERROR, "strftime() and strptime() disagree. "
- "Format: '%s'. In: '%s', out: '%s'. %
d != %
d. Rejecting.",
+ "Format: '%s'. In: '%s', out: '%s'. %
ld != %l
d. Rejecting.",
time_formats[i], header_time, recreated_date, *result, result2);
continue;
}
time_formats[i], header_time, recreated_date, *result, result2);
continue;
}
@@
-4586,7
+4587,11
@@
jb_err get_destination_from_headers(const struct list *headers, struct http_requ
return JB_ERR_PARSE;
}
return JB_ERR_PARSE;
}
- p = strdup_or_die(host);
+ p = string_tolower(host);
+ if (p == NULL)
+ {
+ return JB_ERR_MEMORY;
+ }
chomp(p);
q = strdup_or_die(p);
chomp(p);
q = strdup_or_die(p);
@@
-4673,7
+4678,11
@@
jb_err get_destination_from_https_headers(const struct list *headers, struct htt
return JB_ERR_PARSE;
}
return JB_ERR_PARSE;
}
- p = strdup_or_die(host);
+ p = string_tolower(host);
+ if (p == NULL)
+ {
+ return JB_ERR_MEMORY;
+ }
chomp(p);
q = strdup_or_die(p);
chomp(p);
q = strdup_or_die(p);