Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2455

Workaround for bad use of pn_buffer_append in messenger library

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • proton-c-0.36.0
    • proton-c-0.37.0
    • proton-c
    • 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

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            astitcher Andrew Stitcher
            astitcher Andrew Stitcher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment