Skip to content
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

Merged
merged 1 commit into from
Sep 6, 2018
Merged

Conversation

rcombs
Copy link
Contributor

@rcombs rcombs commented Apr 6, 2018

Call the detail versions, which take pointers, rather than converting the pointers to references and back (which is UB).

Call the detail versions, which take pointers, rather than converting the pointers to references and back (which is UB).
@grembo
Copy link

grembo commented Jul 19, 2018

Could you please merge this? This is causing segfaults in production. Thanks!

@rcombs
Copy link
Contributor Author

rcombs commented Jul 19, 2018

Yeah I should've been more clear, this causes crashes.

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Jul 19, 2018
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
uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Jul 19, 2018
PR:		229888
Approved by:	maintainer
Obtained from:	boostorg/filesystem#71
MFH:		2018Q3 (runtime fix, null pointer dereference)
@grembo
Copy link

grembo commented Jul 19, 2018

The code segment below demonstrates the undefined behaviour (in my case leading to segfaults):

  #include <boost/filesystem.hpp>
  int main()
  {
    boost::filesystem::copy("/tmp/a", "/tmp/b");
  }

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

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Jul 19, 2018
Fix runtime null pointer dereference (undefined behavior)

PR:		229888
Approved by:	maintainer
Obtained from:	boostorg/filesystem#71

Approved by:	ports-secteam (runtime fix blanket)
swills pushed a commit to swills/freebsd-ports that referenced this pull request Jul 20, 2018
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
Jehops pushed a commit to Jehops/freebsd-ports-legacy that referenced this pull request Jul 20, 2018
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
@pokey909
Copy link

@Beman could you please take a look and merge this patch if there are no concerns with the code?

@pdimov pdimov merged commit 6fb9281 into boostorg:develop Sep 6, 2018
biadasiewicz pushed a commit to biadasiewicz/filesystem that referenced this pull request Sep 18, 2018
@jeking3
Copy link

jeking3 commented Nov 6, 2018

Perhaps the CI suite should be running UBSAN and static code analyses?

@pdimov
Copy link
Member

pdimov commented Nov 6, 2018

It is running UBSAN.

@jeking3
Copy link

jeking3 commented Nov 6, 2018

Apologies, I looked at the build results for the PR which is 7 months old.

uqs pushed a commit to freebsd/freebsd-ports that referenced this pull request Apr 1, 2021
Fix runtime null pointer dereference (undefined behavior)

PR:		229888
Approved by:	maintainer
Obtained from:	boostorg/filesystem#71

Approved by:	ports-secteam (runtime fix blanket)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants