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

c++: taking address of element 0 of an empty string or vector

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • proton-0.12.2
    • proton-0.13.0
    • cpp-binding
    • None

    Description

      This bug shows up in a couple places, fixing all. Originally pointed out on the user list:

      http://qpid.2158936.n2.nabble.com/Proton-C-0-12-2-C-vector-subscript-out-of-range-in-unit-tests-td7644983.html

      The problem is using the idiom &x[0] to get the address of storage in a string or vector without first testing that it is not empty.

      Attachments

        Activity

          People

            aconway Alan Conway
            aconway Alan Conway
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: