aboutsummaryrefslogtreecommitdiff
path: root/absl/algorithm
diff options
context:
space:
mode:
authorMartijn Vels <mvels@google.com>2022-12-07 07:14:42 -0800
committerCopybara-Service <copybara-worker@google.com>2022-12-07 07:15:19 -0800
commit5736d76ae60c1746cf6fe60466df655c91bf7a7b (patch)
treef2a307cbb31cc2de71ba424784626d3b3a2568f8 /absl/algorithm
parentc96db73c09dbb528eca6d19a50bd258b37e9fd5e (diff)
downloadabseil-5736d76ae60c1746cf6fe60466df655c91bf7a7b.tar.gz
abseil-5736d76ae60c1746cf6fe60466df655c91bf7a7b.tar.bz2
abseil-5736d76ae60c1746cf6fe60466df655c91bf7a7b.zip
Remove possible UB from CopyRaw()
This change removes the 'create by single memcpy' CopyRaw() logic to avoid potential UB from the atomic refcount data being included in the memcpy. While we know this works on all supported platforms, it is officially UB, and we should change it to something else. This change changes the CopyRaw() method to explicitly create a (default initialized) instance, initialize `length` and `refcount`, and then memcpy the remaining contents which are trivial uint8_t and CordRep* values. PiperOrigin-RevId: 493596072 Change-Id: I46618883eb1c7c9ed9eb083f4d3e7fc501f23df5
Diffstat (limited to 'absl/algorithm')
0 files changed, 0 insertions, 0 deletions