Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
proton-c-0.36.0
-
None
Description
The messenger library uses the pn_buffer API as a way to get expandable memory space. However it just writes directly into the space it gets and then append that space (which is internal to a buffer) to the buffer to adjust the buffers internal bookkeeping.
This is not supposed to be allowed in the API, but didn't matter before as pn_buffer_append used memmove(). It is now technically undefined as we started using memcpy() in pn_buffer_append.
The operation has the same source and destination address so can be elided as aworkaround to avoid the undefined behaviour.
Attachments
Issue Links
- is caused by
-
PROTON-2425 Tweak pn_buffer code to use memcpy instead of memmove
- Closed