Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 382148d

Browse files
authored
Fix UBSAN warning about applying zero offset to null pointer (#10700)
vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.
1 parent 375e740 commit 382148d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎sapi/cli/php_cli_server.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,8 +1785,10 @@ static int php_cli_server_client_read_request_on_message_complete(php_http_parse
17851785
php_cli_server_client *client = parser->data;
17861786
client->request.protocol_version = parser->http_major * 100 + parser->http_minor;
17871787
php_cli_server_request_translate_vpath(&client->request, client->server->document_root, client->server->document_root_len);
1788-
{
1789-
const char *vpath = client->request.vpath, *end = vpath + client->request.vpath_len, *p = end;
1788+
if (client->request.vpath) {
1789+
const char *vpath = client->request.vpath;
1790+
const char *end = vpath + client->request.vpath_len;
1791+
const char *p = end;
17901792
client->request.ext = end;
17911793
client->request.ext_len = 0;
17921794
while (p > vpath) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /