From: William A. Rowe Jr Date: Mon, 14 Sep 2009 16:14:52 +0000 (+0000) Subject: Catch the somewhat absurd combination of a 417 error where no Expect header X-Git-Tag: 2.2.14~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9db8e5c2ef4a8fac33aabbd2aae29813aa6b146a;p=thirdparty%2Fapache%2Fhttpd.git Catch the somewhat absurd combination of a 417 error where no Expect header was present, on some platforms avoiding a segfault. Backports: 814048, 814114 Reviewed by: wrowe, minfrin, covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@814723 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 7a7a46b8d7d..1c54b8d7b81 100644 --- a/STATUS +++ b/STATUS @@ -135,13 +135,6 @@ PATCHES PROPOSED TO BACKPORT FROM TRUNK: 2.2.x patch: http://people.apache.org/~poirier/patch-2.2.x-PR30586.txt +1: poirier, minfrin - * http_protocol: Catch the somewhat absurd combination of a 417 error where - no Expect header was present, on some platforms avoiding a segfault. - Trunk Patch: http://svn.apache.org/viewvc?view=rev&revision=814048 - +1: wrowe - rpluem says: Need to add r814114 to make it compile. - +1: minfrin, covener (with r814114) - * htcacheclean: 19 ways to fail, 1 error message. Fixed. Trunk Patch: http://svn.apache.org/viewvc?view=rev&revision=814091 +1: minfrin, covener, poirier diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 046e98bc579..fdd7d7578ac 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -1005,16 +1005,19 @@ static const char *get_canned_error_string(int status, "request-header field overlap the current extent\n" "of the selected resource.

\n"); case HTTP_EXPECTATION_FAILED: - return(apr_pstrcat(p, - "

The expectation given in the Expect " - "request-header" - "\nfield could not be met by this server.

\n" - "

The client sent

\n    Expect: ",
-                           ap_escape_html(r->pool, apr_table_get(r->headers_in, "Expect")),
-                           "\n
\n" - "but we only allow the 100-continue " - "expectation.

\n", - NULL)); + s1 = apr_table_get(r->headers_in, "Expect"); + if (s1) + s1 = apr_pstrcat(p, + "

The expectation given in the Expect request-header\n" + "field could not be met by this server.\n" + "The client sent

\n    Expect: ",
+                     ap_escape_html(r->pool, s1), "\n
\n", + NULL); + else + s1 = "

No expectation was seen, the Expect request-header \n" + "field was not presented by the client.\n"; + return add_optional_notes(r, s1, "error-notes", "

" + "

Only the 100-continue expectation is supported.

\n"); case HTTP_UNPROCESSABLE_ENTITY: return("

The server understands the media type of the\n" "request entity, but was unable to process the\n"