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

Conversation

Projects
None yet
5 participants
@rcombs
Contributor

rcombs commented Apr 6, 2018

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

Fix undefined behavior in detail::copy
Call the detail versions, which take pointers, rather than converting the pointers to references and back (which is UB).
@grembo

This comment has been minimized.

grembo commented Jul 19, 2018

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

@rcombs

This comment has been minimized.

Contributor

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

grembo
Fix runtime null pointer dereference (undefined behavior)
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

grembo grembo
Fix runtime null pointer dereference (undefined behavior)
PR:		229888
Approved by:	maintainer
Obtained from:	boostorg/filesystem#71
MFH:		2018Q3 (runtime fix, null pointer dereference)
@grembo

This comment has been minimized.

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

grembo grembo
MFH: r474979
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

Michael Gmelin Michael Gmelin
Fix runtime null pointer dereference (undefined behavior)
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 that referenced this pull request Jul 20, 2018

Michael Gmelin Michael Gmelin
Fix runtime null pointer dereference (undefined behavior)
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

mat813 pushed a commit to mat813/freebsd-ports that referenced this pull request Jul 20, 2018

Michael Gmelin Michael Gmelin
Fix runtime null pointer dereference (undefined behavior)
PR:		229888
Approved by:	maintainer
Obtained from:	boostorg/filesystem#71
MFH:		2018Q3 (runtime fix, null pointer dereference)


git-svn-id: https://svn.freebsd.org/ports/head@474979 35697150-7ecd-e111-bb59-0022644237b5

mat813 pushed a commit to mat813/freebsd-ports that referenced this pull request Jul 20, 2018

Michael Gmelin Michael Gmelin
MFH: r474979
Fix runtime null pointer dereference (undefined behavior)

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

Approved by:	ports-secteam (runtime fix blanket)


git-svn-id: https://svn.freebsd.org/ports/branches/2018Q3@474981 35697150-7ecd-e111-bb59-0022644237b5
@pokey909

This comment has been minimized.

pokey909 commented Jul 25, 2018

@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

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

biadasiewicz pushed a commit to biadasiewicz/filesystem that referenced this pull request Sep 18, 2018

@jeking3

This comment has been minimized.

jeking3 commented Nov 6, 2018

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

@pdimov

This comment has been minimized.

Collaborator

pdimov commented Nov 6, 2018

It is running UBSAN.

@jeking3

This comment has been minimized.

jeking3 commented Nov 6, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment