X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=parsers.c;h=8b1a7a7ada17d06f9267dc9b7292adf454b94c22;hb=e11bc95711b7da314179cb6ae3e37a0dd9e64738;hp=3f5c626f5940d4fe538384f124d566355d7bce1e;hpb=61783b0364abc9d3e9eb314b7c4bf2651822b121;p=privoxy.git diff --git a/parsers.c b/parsers.c index 3f5c626f..8b1a7a7a 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.291 2014/07/25 11:56:54 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.292 2014/07/25 11:57:17 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -3865,15 +3865,21 @@ static jb_err server_http(struct client_state *csp, char **header) { p++; reason_phrase = strchr(p, ' '); - if (reason_phrase != NULL) - { - reason_phrase++; - } } - if ((reason_phrase == NULL) || (reason_phrase[0] == '\0') || - (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version, - &minor_version, &(csp->http->status)))) + if (reason_phrase != NULL) + { + reason_phrase++; + } + else + { + log_error(LOG_LEVEL_ERROR, + "Response line lacks reason phrase: %s", *header); + reason_phrase=""; + } + + if (3 != sscanf(*header, "HTTP/%u.%u %u", &major_version, + &minor_version, &(csp->http->status))) { log_error(LOG_LEVEL_ERROR, "Failed to parse the response line: %s", *header);