Bug 631567 - The C++ address parser throws an exception and leaks memory if it parses an empty list
Summary: The C++ address parser throws an exception and leaks memory if it parses an e...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-cpp
Version: Development
Hardware: All
OS: Linux
medium
medium
Target Milestone: 1.3.0.1
: ---
Assignee: Jonathan Robie
QA Contact: ppecka
URL:
Whiteboard:
Depends On:
Blocks: 652091
TreeView+ depends on / blocked
 
Reported: 2010-09-07 21:30 UTC by Ted Ross
Modified: 2011-08-12 16:22 UTC (History)
5 users (show)

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.
Clone Of:
: 652091 (view as bug list)
Environment:
Last Closed: 2010-11-30 17:51:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch that adds two new tests to the unit test Address.cpp (1.11 KB, patch)
2010-09-07 21:30 UTC, Ted Ross
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0921 0 normal SHIPPED_LIVE Important: Red Hat Enterprise MRG Messaging and Grid security update 2010-11-30 17:50:15 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.