coar 99/05/26 11:28:16
Modified: src CHANGES src/main http_protocol.c Log: Make sure that redirect processing looks for the "Location" field in both headers_out and err_headers_out. Revision Changes Path 1.1363 +5 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1362 retrieving revision 1.1363 diff -u -r1.1362 -r1.1363 --- CHANGES 1999/05/25 10:23:15 1.1362 +++ CHANGES 1999/05/26 18:27:43 1.1363 @@ -1,5 +1,10 @@ Changes with Apache 1.3.7 + *) If a "Location" field was stored in r->err_headers_out rather + than r->headers_out, redirect processing wouldn't find it and + the server would core dump on ap_escape_html(NULL). + [Doug MacEachern, Ken Coar] + *) Add RULE_EXPAT, the src/lib/ directory structure, and a modified copy of the Expat 1.0.2 distribution. [Greg Stein] 1.268 +11 -2 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.267 retrieving revision 1.268 diff -u -r1.267 -r1.268 --- http_protocol.c 1999/05/03 15:09:07 1.267 +++ http_protocol.c 1999/05/26 18:28:06 1.268 @@ -2308,6 +2308,14 @@ char *custom_response; const char *location = ap_table_get(r->headers_out, "Location"); + /* + * It's possible that the Location field might be in r->err_headers_out + * instead of r->headers_out; use the latter if possible, else the + * former. + */ + if (location == NULL) { + location = ap_table_get(r->err_headers_out, "Location"); + } /* We need to special-case the handling of 204 and 304 responses, * since they have specific HTTP requirements and do not include a * message body. Note that being assbackwards here is not an option. @@ -2359,9 +2367,10 @@ r->err_headers_out = tmp; ap_clear_table(r->err_headers_out); - if (location && *location - && (ap_is_HTTP_REDIRECT(status) || status == HTTP_CREATED)) + if ((location != NULL) && *location + && (ap_is_HTTP_REDIRECT(status) || status == HTTP_CREATED)) { ap_table_setn(r->headers_out, "Location", location); + } r->content_language = NULL; r->content_languages = NULL;