diff --git a/runtime/interface.cpp b/runtime/interface.cpp index 8f11b8862f..5a0432f01c 100644 --- a/runtime/interface.cpp +++ b/runtime/interface.cpp @@ -1799,7 +1799,7 @@ static void init_superglobals_impl(const http_query_data &http_data, const rpc_q } static http_query_data empty_http_data; -static rpc_query_data empty_rpc_data{tl_query_header_t(), {}, {}}; +static rpc_query_data empty_rpc_data; static job_query_data empty_job_data; void init_superglobals(const php_query_data_t &data) { diff --git a/server/php-engine.cpp b/server/php-engine.cpp index 5430a7a79a..4610dd7f08 100644 --- a/server/php-engine.cpp +++ b/server/php-engine.cpp @@ -983,7 +983,7 @@ int rpcx_execute(connection *c, int op, raw_message *raw) { int64_t left_bytes_without_headers = tl_fetch_unread(); len -= (left_bytes_with_headers - left_bytes_without_headers); - assert(len % 4 == 0); + assert(len % sizeof(int) == 0); long long req_id = header.qid; @@ -1009,7 +1009,7 @@ int rpcx_execute(connection *c, int op, raw_message *raw) { double actual_script_timeout = custom_settings.has_timeout() ? normalize_script_timeout(custom_settings.php_timeout_ms / 1000.0) : script_timeout; set_connection_timeout(c, actual_script_timeout); - std::vector buffer((len + sizeof(int)) / sizeof(int)); + std::vector buffer(len / sizeof(int)); auto fetched_bytes = tl_fetch_data(buffer.data(), len); if (fetched_bytes == -1) { client_rpc_error(c, req_id, tl_fetch_error_code(), tl_fetch_error_string());