mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
Fixed bug #60206 (possible integer overflow in content_length)
This commit is contained in:
parent
6c01aacc0d
commit
a391535e00
7 changed files with 9 additions and 6 deletions
3
NEWS
3
NEWS
|
@ -137,6 +137,9 @@ PHP NEWS
|
||||||
- FTP:
|
- FTP:
|
||||||
. Fixed bug #60183 (out of sync ftp responses). (bram at ebskamp dot me, rasmus)
|
. Fixed bug #60183 (out of sync ftp responses). (bram at ebskamp dot me, rasmus)
|
||||||
|
|
||||||
|
- SAPI:
|
||||||
|
. Fixed bug #60205 (possible integer overflow in content_length). (Laruence)
|
||||||
|
|
||||||
|
|
||||||
23 Aug 2011, PHP 5.3.8
|
23 Aug 2011, PHP 5.3.8
|
||||||
|
|
||||||
|
|
|
@ -533,7 +533,7 @@ static void init_request_info(TSRMLS_D)
|
||||||
SG(request_info).request_uri = r->uri;
|
SG(request_info).request_uri = r->uri;
|
||||||
SG(request_info).request_method = (char *)r->method;
|
SG(request_info).request_method = (char *)r->method;
|
||||||
SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE");
|
SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE");
|
||||||
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
|
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
|
||||||
SG(sapi_headers).http_response_code = r->status;
|
SG(sapi_headers).http_response_code = r->status;
|
||||||
SG(request_info).proto_num = r->proto_num;
|
SG(request_info).proto_num = r->proto_num;
|
||||||
|
|
||||||
|
|
|
@ -420,7 +420,7 @@ static void php_apache_request_ctor(ap_filter_t *f, php_struct *ctx TSRMLS_DC)
|
||||||
efree(content_type);
|
efree(content_type);
|
||||||
|
|
||||||
content_length = (char *) apr_table_get(f->r->headers_in, "Content-Length");
|
content_length = (char *) apr_table_get(f->r->headers_in, "Content-Length");
|
||||||
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
|
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
|
||||||
|
|
||||||
apr_table_unset(f->r->headers_out, "Content-Length");
|
apr_table_unset(f->r->headers_out, "Content-Length");
|
||||||
apr_table_unset(f->r->headers_out, "Last-Modified");
|
apr_table_unset(f->r->headers_out, "Last-Modified");
|
||||||
|
|
|
@ -484,7 +484,7 @@ static int php_apache_request_ctor(request_rec *r, php_struct *ctx TSRMLS_DC)
|
||||||
r->no_local_copy = 1;
|
r->no_local_copy = 1;
|
||||||
|
|
||||||
content_length = (char *) apr_table_get(r->headers_in, "Content-Length");
|
content_length = (char *) apr_table_get(r->headers_in, "Content-Length");
|
||||||
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
|
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
|
||||||
|
|
||||||
apr_table_unset(r->headers_out, "Content-Length");
|
apr_table_unset(r->headers_out, "Content-Length");
|
||||||
apr_table_unset(r->headers_out, "Last-Modified");
|
apr_table_unset(r->headers_out, "Last-Modified");
|
||||||
|
|
|
@ -587,7 +587,7 @@ static void init_request_info(TSRMLS_D)
|
||||||
SG(request_info).request_method = (char *)r->method;
|
SG(request_info).request_method = (char *)r->method;
|
||||||
SG(request_info).proto_num = r->proto_num;
|
SG(request_info).proto_num = r->proto_num;
|
||||||
SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE");
|
SG(request_info).content_type = (char *) table_get(r->subprocess_env, "CONTENT_TYPE");
|
||||||
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
|
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
|
||||||
SG(sapi_headers).http_response_code = r->status;
|
SG(sapi_headers).http_response_code = r->status;
|
||||||
|
|
||||||
if (r->headers_in) {
|
if (r->headers_in) {
|
||||||
|
|
|
@ -1353,7 +1353,7 @@ static void init_request_info(TSRMLS_D)
|
||||||
/* FIXME - Work out proto_num here */
|
/* FIXME - Work out proto_num here */
|
||||||
SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING")-1 TSRMLS_CC);
|
SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING")-1 TSRMLS_CC);
|
||||||
SG(request_info).content_type = (content_type ? content_type : "" );
|
SG(request_info).content_type = (content_type ? content_type : "" );
|
||||||
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
|
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
|
||||||
|
|
||||||
/* The CGI RFC allows servers to pass on unvalidated Authorization data */
|
/* The CGI RFC allows servers to pass on unvalidated Authorization data */
|
||||||
auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION")-1 TSRMLS_CC);
|
auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION")-1 TSRMLS_CC);
|
||||||
|
|
|
@ -1332,7 +1332,7 @@ static void init_request_info(TSRMLS_D)
|
||||||
/* FIXME - Work out proto_num here */
|
/* FIXME - Work out proto_num here */
|
||||||
SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING") - 1 TSRMLS_CC);
|
SG(request_info).query_string = sapi_cgibin_getenv("QUERY_STRING", sizeof("QUERY_STRING") - 1 TSRMLS_CC);
|
||||||
SG(request_info).content_type = (content_type ? content_type : "" );
|
SG(request_info).content_type = (content_type ? content_type : "" );
|
||||||
SG(request_info).content_length = (content_length ? atoi(content_length) : 0);
|
SG(request_info).content_length = (content_length ? atol(content_length) : 0);
|
||||||
|
|
||||||
/* The CGI RFC allows servers to pass on unvalidated Authorization data */
|
/* The CGI RFC allows servers to pass on unvalidated Authorization data */
|
||||||
auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION") - 1 TSRMLS_CC);
|
auth = sapi_cgibin_getenv("HTTP_AUTHORIZATION", sizeof("HTTP_AUTHORIZATION") - 1 TSRMLS_CC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue