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

Fix UBSAN warning about applying zero offset to null pointer #10700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Girgias merged 1 commit into php:master from Girgias:cli-sapi-ubsan
Feb 26, 2023

Conversation

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.
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.

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. :)

nielsdos reacted with thumbs up emoji

@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
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

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