activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Strasheim (JIRA)" <>
Subject [jira] Created: (AMQCPP-43) Crash when getting string property that doesn't exist
Date Fri, 12 Jan 2007 14:14:48 GMT
Crash when getting string property that doesn't exist

                 Key: AMQCPP-43
             Project: ActiveMQ C++ Client
          Issue Type: Bug
          Components: CMS Impl
    Affects Versions: 1.1
            Reporter: Albert Strasheim
         Assigned To: Nathan Mittler
            Priority: Minor
             Fix For: 1.1

In the case when one calls getStringProperty for a property that doesn't exist, a crash occurs
because SimpleProperties returns NULL. I think it should return "".

Test code on Linux:

#include <string>
int main(int argc, char* argv)
    std::string str(0);
    return 0;

This dies with the following when run on FC6:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid

Proposed patch:

--- src/main/activemq/util/SimpleProperties.h   (revision 495567)
+++ src/main/activemq/util/SimpleProperties.h   (working copy)
@@ -55,7 +55,7 @@
             std::map< std::string, std::string >::const_iterator iter =
             properties.find( name );
             if( iter == properties.end() ){
-                return NULL;
+                return "";

             return iter->second.c_str();

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message