-
Notifications
You must be signed in to change notification settings - Fork 162
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
Fix undefined behavior in detail::copy #71
Conversation
Call the detail versions, which take pointers, rather than converting the pointers to references and back (which is UB).
Could you please merge this? This is causing segfaults in production. Thanks! |
Yeah I should've been more clear, this causes crashes. |
PR: 229888 Approved by: maintainer Obtained from: boostorg/filesystem#71 MFH: 2018Q3 (runtime fix, null pointer dereference) git-svn-id: svn+ssh://svn.freebsd.org/ports/head@474979 35697150-7ecd-e111-bb59-0022644237b5
PR: 229888 Approved by: maintainer Obtained from: boostorg/filesystem#71 MFH: 2018Q3 (runtime fix, null pointer dereference)
The code segment below demonstrates the undefined behaviour (in my case leading to segfaults):
See here for a more detailed description of the problem (adding the patch to the freebsd ports tree): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229888 |
Fix runtime null pointer dereference (undefined behavior) PR: 229888 Approved by: maintainer Obtained from: boostorg/filesystem#71 Approved by: ports-secteam (runtime fix blanket)
PR: 229888 Approved by: maintainer Obtained from: boostorg/filesystem#71 MFH: 2018Q3 (runtime fix, null pointer dereference) git-svn-id: svn+ssh://svn.freebsd.org/ports/head@474979 35697150-7ecd-e111-bb59-0022644237b5
PR: 229888 Approved by: maintainer Obtained from: boostorg/filesystem#71 MFH: 2018Q3 (runtime fix, null pointer dereference) git-svn-id: svn+ssh://svn.freebsd.org/ports/head@474979 35697150-7ecd-e111-bb59-0022644237b5
@Beman could you please take a look and merge this patch if there are no concerns with the code? |
Perhaps the CI suite should be running UBSAN and static code analyses? |
It is running UBSAN. |
Apologies, I looked at the build results for the PR which is 7 months old. |
Fix runtime null pointer dereference (undefined behavior) PR: 229888 Approved by: maintainer Obtained from: boostorg/filesystem#71 Approved by: ports-secteam (runtime fix blanket)
Call the detail versions, which take pointers, rather than converting the pointers to references and back (which is UB).