mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Safe casts - we are assured that len_read is positive, but it must be
stored as an int to initially check the ap_get_client_block() result. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89717 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -682,7 +682,7 @@ static int cgi_handler(request_rec *r)
|
|||||||
* Note that we already ignore SIGPIPE in the core server.
|
* Note that we already ignore SIGPIPE in the core server.
|
||||||
*/
|
*/
|
||||||
if (ap_should_client_block(r)) {
|
if (ap_should_client_block(r)) {
|
||||||
int dbsize, len_read;
|
int len_read, dbsize;
|
||||||
apr_size_t bytes_written, bytes_to_write;
|
apr_size_t bytes_written, bytes_to_write;
|
||||||
apr_status_t rv;
|
apr_status_t rv;
|
||||||
|
|
||||||
@@ -712,8 +712,9 @@ static int cgi_handler(request_rec *r)
|
|||||||
rv = apr_file_write(script_out, argsbuffer + bytes_written,
|
rv = apr_file_write(script_out, argsbuffer + bytes_written,
|
||||||
&bytes_to_write);
|
&bytes_to_write);
|
||||||
bytes_written += bytes_to_write;
|
bytes_written += bytes_to_write;
|
||||||
} while (rv == APR_SUCCESS && bytes_written < len_read);
|
} while (rv == APR_SUCCESS
|
||||||
if (rv != APR_SUCCESS || bytes_written < len_read) {
|
&& bytes_written < (apr_size_t)len_read);
|
||||||
|
if (rv != APR_SUCCESS || bytes_written < (apr_size_t)len_read) {
|
||||||
/* silly script stopped reading, soak up remaining message */
|
/* silly script stopped reading, soak up remaining message */
|
||||||
while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN) > 0) {
|
while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN) > 0) {
|
||||||
/* dump it */
|
/* dump it */
|
||||||
|
Reference in New Issue
Block a user