Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 631567

Summary: The C++ address parser throws an exception and leaks memory if it parses an empty list
Product: Red Hat Enterprise MRG Reporter: Ted Ross <tross>
Component: qpid-cppAssignee: Jonathan Robie <jonathan.robie>
Status: CLOSED ERRATA QA Contact: ppecka <ppecka>
Severity: medium Docs Contact:
Priority: medium    
Version: DevelopmentCC: gsim, iboverma, jneedle, ppecka, tross
Target Milestone: 1.3.0.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
An empty list in the content of an address (i.e. []) caused the address parser to throw an exception. This could cause various operations (e.g. creating a messaging receiver) to fail. With this update, the address parser was fixed so that it can properly parse empty lists, thus, the aforementioned exceptions are no longer thrown.
Story Points: ---
Clone Of:
: 652091 (view as bug list) Environment:
Last Closed: 2010-11-30 17:51:06 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 652091    
Attachments:
Description Flags
Patch that adds two new tests to the unit test Address.cpp none

Description Ted Ross 2010-09-07 21:30:44 UTC
Created attachment 445791 [details]
Patch that adds two new tests to the unit test Address.cpp

Description of problem:

If there is an empty list ([]) in the content of an address (e.g. in the options), the address parser will throw an exception and leak the memory associated with the AddressImpl.

Version-Release number of selected component (if applicable):

MRG 1.3 Beta

How reproducible:

100%

Steps to Reproduce:

See attached patch to the unit tests.
  
Actual results:

Test passes

Expected results:

Test fails and valgrind issues are identified.

Comment 1 Ted Ross 2010-09-07 22:04:44 UTC
Of course, the actual and expected results are reversed as reported.

Comment 2 Jonathan Robie 2010-09-16 14:53:20 UTC
Fixed upstream in revision 997771.

Comment 3 Jonathan Robie 2010-11-05 20:58:51 UTC
Cherry-picked into:

mrg_1.3.x
ea2768b0063277dc64f2630372cb5ebb1d98365f

Comment 4 Ted Ross 2010-11-10 02:32:14 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: An empty list in the content of an address (i.e. "[]") causes the address parser to throw an exception.

Consequence: An operation (creating a messaging receiver, for example) may fail unnecessarily.

Fix: The address parser was fixed so that it can properly parse empty lists.

Result: Exceptions are not thrown unnecessarily.

Comment 6 ppecka 2010-11-10 16:26:35 UTC
Verified on RHEL( 4.8 | 5.5 ) && ( i386 | x86_64 )

tested with
./spout "queue-empty-map; {create: always,node:{},}" --content "msg" 
./spout "queue-empty-list; {create: always,node:{type:queue,x-bindings:[]},}" --content "msg" ; qpid-config queues queue


# rpm -qa | grep qpid | sort
python-qpid-0.7.946106-14.el5
qpid-cpp-client-0.7.946106-19.el5
qpid-cpp-client-devel-0.7.946106-19.el5
qpid-cpp-client-devel-docs-0.7.946106-19.el5
qpid-cpp-client-ssl-0.7.946106-19.el5
qpid-cpp-mrg-debuginfo-0.7.946106-19.el5
qpid-cpp-server-0.7.946106-19.el5
qpid-cpp-server-cluster-0.7.946106-19.el5
qpid-cpp-server-devel-0.7.946106-19.el5
qpid-cpp-server-ssl-0.7.946106-19.el5
qpid-cpp-server-store-0.7.946106-19.el5
qpid-cpp-server-xml-0.7.946106-19.el5
qpid-java-client-0.7.946106-11.el5
qpid-java-common-0.7.946106-11.el5
qpid-java-example-0.7.946106-11.el5
qpid-tools-0.7.946106-11.el5

--> VERIFIED

Comment 8 errata-xmlrpc 2010-11-30 17:51:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0921.html

Comment 9 Martin Prpič 2010-12-01 14:51:56 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,7 +1 @@
-Cause: An empty list in the content of an address (i.e. "[]") causes the address parser to throw an exception.
+An empty list in the content of an address (i.e. []) caused the address parser to throw an exception. This could cause various operations (e.g. creating a messaging receiver) to fail. With this update, the address parser was fixed so that it can properly parse empty lists, thus, the aforementioned exceptions are no longer thrown.-
-Consequence: An operation (creating a messaging receiver, for example) may fail unnecessarily.
-
-Fix: The address parser was fixed so that it can properly parse empty lists.
-
-Result: Exceptions are not thrown unnecessarily.