[ https://issues.apache.org/jira/browse/PROTON-835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14350569#comment-14350569 ]
ASF subversion and git services commented on PROTON-835: -------------------------------------------------------- Commit 304f6dfda72ec8d2f09df0efff3b0c16f2f3782e in qpid-proton's branch refs/heads/master from [~aconway] [ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=304f6df ] PROTON-835: strncmp in pn_data_lookup doesn't work in some cases > strncmp in pn_data_lookup doesn't work in some cases > ---------------------------------------------------- > > Key: PROTON-835 > URL: https://issues.apache.org/jira/browse/PROTON-835 > Project: Qpid Proton > Issue Type: Bug > Components: proton-c > Affects Versions: 0.8 > Reporter: Sergejs Melderis > Priority: Critical > > pn_data_lookup in codec.c doesn't always work correctly when a message has > two properties in which one property is a prefix for another. In my > particular use case the properties were 'msc_gt' and 'msc_gt_service'. and > the pn_data_lookup was returning a pointer to 'msc_gt' when was called with > 'msc_gt_service'. > I fixed it by comparing the length of pn_bytes_t and the length of the > property name as so: > size_t namelen = strlen(name); > pn_bytes_t bytes = pn_data_get_bytes(data); > if (namelen == bytes.size && !strncmp(name, bytes.start, bytes.size)) { > return pn_data_next(data); > } > -- This message was sent by Atlassian JIRA (v6.3.4#6332)