mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-06 18:58:09 -04:00
fix an embarassing bug where strchr was used with a cstring instead of a char
svn:r383
This commit is contained in:
parent
8ea5ffefc3
commit
073d359061
7
http.c
7
http.c
@ -1120,10 +1120,13 @@ int
|
||||
evhttp_add_header(struct evkeyvalq *headers,
|
||||
const char *key, const char *value)
|
||||
{
|
||||
struct evkeyval *header;
|
||||
struct evkeyval *header = NULL;
|
||||
|
||||
if (strchr(value, "\r") != NULL || strchr(value, "\n") != NULL) {
|
||||
event_debug(("%s: key: %s val: %s\n", __func__, key, value));
|
||||
|
||||
if (strchr(value, '\r') != NULL || strchr(value, '\n') != NULL) {
|
||||
/* drop illegal headers */
|
||||
event_debug(("%s: dropping illegal header\n"));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@ -517,6 +517,11 @@ http_postrequest_done(struct evhttp_request *req, void *arg)
|
||||
{
|
||||
const char *what = "This is funny";
|
||||
|
||||
if (req == NULL) {
|
||||
fprintf(stderr, "FAILED (timeout)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (req->response_code != HTTP_OK) {
|
||||
|
||||
fprintf(stderr, "FAILED (response code)\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user