summaryrefslogtreecommitdiff
path: root/sapi/cli/php_http_parser.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-08-18 09:16:04 +0000
committerPierre Joye <pajoye@php.net>2011-08-18 09:16:04 +0000
commit0fd3f882cdf96ac58b08648f9b9d577829e3799c (patch)
tree3721fe41a817f112b3cf1e663efba92cde0cee2c /sapi/cli/php_http_parser.c
parent8e0c2e1cb900c26e33e2032972c4b1e297682893 (diff)
downloadphp-git-0fd3f882cdf96ac58b08648f9b9d577829e3799c.tar.gz
- do not use 64bit integer instead of size_t (can't be alloc'ed), or when the actual possible values are 32bit or lower only
Diffstat (limited to 'sapi/cli/php_http_parser.c')
-rw-r--r--sapi/cli/php_http_parser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index 5d5e44e3e5..e58fba3410 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -323,12 +323,12 @@ size_t php_http_parser_execute (php_http_parser *parser,
{
char c, ch;
const char *p = data, *pe;
- int64_t to_read;
+ size_t to_read;
enum state state = (enum state) parser->state;
enum header_states header_state = (enum header_states) parser->header_state;
- uint64_t index = parser->index;
- uint64_t nread = parser->nread;
+ uint32_t index = parser->index;
+ uint32_t nread = parser->nread;
/* technically we could combine all of these (except for url_mark) into one
variable, saving stack space, but it seems more clear to have them
@@ -1425,7 +1425,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
}
case s_body_identity:
- to_read = MIN(pe - p, (int64_t)parser->content_length);
+ to_read = MIN(pe - p, (size_t)parser->content_length);
if (to_read > 0) {
if (settings->on_body) settings->on_body(parser, p, to_read);
p += to_read - 1;
@@ -1510,7 +1510,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
{
assert(parser->flags & F_CHUNKED);
- to_read = MIN(pe - p, (int64_t)(parser->content_length));
+ to_read = MIN(pe - p, (size_t)(parser->content_length));
if (to_read > 0) {
if (settings->on_body) settings->on_body(parser, p, to_read);