You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/06/02 19:31:59 UTC

[jira] [Commented] (PROTON-1225) c++: taking address of element 0 of an empty string or vector

    [ https://issues.apache.org/jira/browse/PROTON-1225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15312919#comment-15312919 ] 

ASF subversion and git services commented on PROTON-1225:
---------------------------------------------------------

Commit b57e6ea7d7318caf83a36648164637ae2d3afa66 in qpid-proton's branch refs/heads/master from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=b57e6ea ]

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

Added x.empty() checks and assertions to all uses of the &x[0] idiom.


> c++: taking address of element 0 of an empty string or vector
> -------------------------------------------------------------
>
>                 Key: PROTON-1225
>                 URL: https://issues.apache.org/jira/browse/PROTON-1225
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: cpp-binding
>    Affects Versions: 0.12.2
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>            Priority: Blocker
>             Fix For: 0.13.0
>
>
> 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. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org