Skip to content

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Feb 25, 2023

vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.

vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.
@nielsdos
Copy link
Member

Makes sense to me. Ig we could move the variable definition of const char *vpath = client->request.vpath; out of the if body and then check for vpath in the condition instead. However, the compiler should be smart enough to do that optimisation itself.

@Girgias
Copy link
Member Author

Girgias commented Feb 26, 2023

Makes sense to me. Ig we could move the variable definition of const char *vpath = client->request.vpath; out of the if body and then check for vpath in the condition instead. However, the compiler should be smart enough to do that optimisation itself.

I suppose, but I think it was scoped to support C89 compilers prior to us moving to C99, but yeah hopefully the compiler is smart enough to do this. :)

@Girgias Girgias merged commit 382148d into php:master Feb 26, 2023
@Girgias Girgias deleted the cli-sapi-ubsan branch February 26, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants