-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.
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.
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 forvpath
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. :)
vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.