summaryrefslogtreecommitdiff
path: root/sapi/cli
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cli')
-rw-r--r--sapi/cli/php_http_parser.c7
-rw-r--r--sapi/cli/ps_title.c2
2 files changed, 6 insertions, 3 deletions
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index d3bc496f4e..cc649af79a 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -1431,7 +1431,9 @@ size_t php_http_parser_execute (php_http_parser *parser,
}
case s_body_identity:
- to_read = MIN(pe - p, (size_t)parser->content_length);
+ assert(pe >= p);
+
+ to_read = MIN((size_t)(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;
@@ -1515,8 +1517,9 @@ size_t php_http_parser_execute (php_http_parser *parser,
case s_chunk_data:
{
assert(parser->flags & F_CHUNKED);
+ assert(pe >= p);
- to_read = MIN(pe - p, (size_t)(parser->content_length));
+ to_read = MIN((size_t)(pe - p), (size_t)(parser->content_length));
if (to_read > 0) {
if (settings->on_body) settings->on_body(parser, p, to_read);
diff --git a/sapi/cli/ps_title.c b/sapi/cli/ps_title.c
index 0be94e3eb0..97eec86e5b 100644
--- a/sapi/cli/ps_title.c
+++ b/sapi/cli/ps_title.c
@@ -386,7 +386,7 @@ int get_ps_title(int *displen, const char** string)
return rc;
#ifdef PS_USE_WIN32
- if (!(ps_buffer_cur_len = GetConsoleTitle(ps_buffer, ps_buffer_size)))
+ if (!(ps_buffer_cur_len = GetConsoleTitle(ps_buffer, (DWORD)ps_buffer_size)))
return PS_TITLE_WINDOWS_ERROR;
#endif
*displen = (int)ps_buffer_cur_len;