List Info

Thread: Created: (AMQCPP-149) Client crash when receiving message with empty string property from jav




Created: (AMQCPP-149) Client crash when receiving message with empty string property from jav
country flaguser name
United States
2007-10-19 07:40:24
Client crash when receiving message with empty string
property from java
------------------------------------------------------------
------------

                 Key: AMQCPP-149
                 URL: 
https://issues.apache.org/activemq/browse/AMQCPP-149
             Project: ActiveMQ C++ Client
          Issue Type: Bug
          Components: Openwire
    Affects Versions: 2.1, 2.0.1
            Reporter: Marco Renz
            Assignee: Nathan Mittler


Send message from a java client with a string property
whereas the value is the empty string.
Try to receive this message with a C++ client.
Result: C++ client crashs.

Reason:

In OpenwireStringSupport::readString a std::vector is
initialized to the string length which is 0. Then
DataInputStream::readFully is called with the vector as
argument. But this method tries to get the element at index
0 of the vector without any check. But there is no element
in the vector at all...

Proposed solution:

DataInputStream::readFully  should check the size of the
vector before accessing elements.

Further info:

If the message is send from C++ client then there is no
problem. Maybe /0 is used so that the vector has at least a
size of 1.
I got that probelm with 2.0.1. I did not tried 2.1 but
checked the code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


Updated: (AMQCPP-149) Client crash when receiving message with empty string property from jav
country flaguser name
United States
2007-10-19 08:18:23
     [ https://issues.apache.org/activemq/browse/AMQCPP-149?p
age=com.atlassian.jira.plugin.system.issuetabpanels:all-tabp
anel ]

Timothy Bish updated AMQCPP-149:
--------------------------------

    Affects Version/s: 2.0
        Fix Version/s: 2.1.1
             Assignee: Timothy Bish  (was: Nathan Mittler)

> Client crash when receiving message with empty string
property from java
>
------------------------------------------------------------
------------
>
>                 Key: AMQCPP-149
>                 URL: 
https://issues.apache.org/activemq/browse/AMQCPP-149
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Openwire
>    Affects Versions: 2.0, 2.0.1, 2.1
>            Reporter: Marco Renz
>            Assignee: Timothy Bish
>             Fix For: 2.1.1
>
>   Original Estimate: 1 minute
>  Remaining Estimate: 1 minute
>
> Send message from a java client with a string property
whereas the value is the empty string.
> Try to receive this message with a C++ client.
> Result: C++ client crashs.
> Reason:
> In OpenwireStringSupport::readString a std::vector is
initialized to the string length which is 0. Then
DataInputStream::readFully is called with the vector as
argument. But this method tries to get the element at index
0 of the vector without any check. But there is no element
in the vector at all...
> Proposed solution:
> DataInputStream::readFully  should check the size of
the vector before accessing elements.
> Further info:
> If the message is send from C++ client then there is no
problem. Maybe /0 is used so that the vector has at least a
size of 1.
> I got that probelm with 2.0.1. I did not tried 2.1 but
checked the code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


Commented: (AMQCPP-149) Client crash when receiving message with empty string property from j
country flaguser name
United States
2007-10-19 12:56:23
    [ https://issues.apache.org/activemq/br
owse/AMQCPP-149?page=com.atlassian.jira.plugin.system.issuet
abpanels:comment-tabpanel#action_40435 ] 

Timothy Bish commented on AMQCPP-149:
-------------------------------------

There's definitely an issue here, but I also found even a
null string in a property causes a crash, which is also not
good.



> Client crash when receiving message with empty string
property from java
>
------------------------------------------------------------
------------
>
>                 Key: AMQCPP-149
>                 URL: 
https://issues.apache.org/activemq/browse/AMQCPP-149
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Openwire
>    Affects Versions: 2.0, 2.0.1, 2.1
>            Reporter: Marco Renz
>            Assignee: Timothy Bish
>             Fix For: 2.1.1
>
>   Original Estimate: 1 minute
>  Remaining Estimate: 1 minute
>
> Send message from a java client with a string property
whereas the value is the empty string.
> Try to receive this message with a C++ client.
> Result: C++ client crashs.
> Reason:
> In OpenwireStringSupport::readString a std::vector is
initialized to the string length which is 0. Then
DataInputStream::readFully is called with the vector as
argument. But this method tries to get the element at index
0 of the vector without any check. But there is no element
in the vector at all...
> Proposed solution:
> DataInputStream::readFully  should check the size of
the vector before accessing elements.
> Further info:
> If the message is send from C++ client then there is no
problem. Maybe /0 is used so that the vector has at least a
size of 1.
> I got that probelm with 2.0.1. I did not tried 2.1 but
checked the code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


Commented: (AMQCPP-149) Client crash when receiving message with empty string property from j
country flaguser name
United States
2007-10-19 14:26:23
    [ https://issues.apache.org/activemq/br
owse/AMQCPP-149?page=com.atlassian.jira.plugin.system.issuet
abpanels:comment-tabpanel#action_40442 ] 

Timothy Bish commented on AMQCPP-149:
-------------------------------------

I've resolved the readFully error in trunk.  I'm still
looking into the error that we get we a property is set to
null by a java client.

Update both ActiveMQ and Decaf DataInputStream class and
test.

> Client crash when receiving message with empty string
property from java
>
------------------------------------------------------------
------------
>
>                 Key: AMQCPP-149
>                 URL: 
https://issues.apache.org/activemq/browse/AMQCPP-149
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Openwire
>    Affects Versions: 2.0, 2.0.1, 2.1
>            Reporter: Marco Renz
>            Assignee: Timothy Bish
>             Fix For: 2.1.1
>
>   Original Estimate: 1 minute
>  Remaining Estimate: 1 minute
>
> Send message from a java client with a string property
whereas the value is the empty string.
> Try to receive this message with a C++ client.
> Result: C++ client crashs.
> Reason:
> In OpenwireStringSupport::readString a std::vector is
initialized to the string length which is 0. Then
DataInputStream::readFully is called with the vector as
argument. But this method tries to get the element at index
0 of the vector without any check. But there is no element
in the vector at all...
> Proposed solution:
> DataInputStream::readFully  should check the size of
the vector before accessing elements.
> Further info:
> If the message is send from C++ client then there is no
problem. Maybe /0 is used so that the vector has at least a
size of 1.
> I got that probelm with 2.0.1. I did not tried 2.1 but
checked the code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


Resolved: (AMQCPP-149) Client crash when receiving message with empty string property from ja
country flaguser name
United States
2007-10-24 13:48:24
     [ https://issues.apache.org/activemq/browse/AMQCPP-149?p
age=com.atlassian.jira.plugin.system.issuetabpanels:all-tabp
anel ]

Timothy Bish resolved AMQCPP-149.
---------------------------------

    Resolution: Fixed

Resolved in trunk

> Client crash when receiving message with empty string
property from java
>
------------------------------------------------------------
------------
>
>                 Key: AMQCPP-149
>                 URL: 
https://issues.apache.org/activemq/browse/AMQCPP-149
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Openwire
>    Affects Versions: 2.0, 2.0.1, 2.1
>            Reporter: Marco Renz
>            Assignee: Timothy Bish
>             Fix For: 2.1.1
>
>   Original Estimate: 1 minute
>  Remaining Estimate: 1 minute
>
> Send message from a java client with a string property
whereas the value is the empty string.
> Try to receive this message with a C++ client.
> Result: C++ client crashs.
> Reason:
> In OpenwireStringSupport::readString a std::vector is
initialized to the string length which is 0. Then
DataInputStream::readFully is called with the vector as
argument. But this method tries to get the element at index
0 of the vector without any check. But there is no element
in the vector at all...
> Proposed solution:
> DataInputStream::readFully  should check the size of
the vector before accessing elements.
> Further info:
> If the message is send from C++ client then there is no
problem. Maybe /0 is used so that the vector has at least a
size of 1.
> I got that probelm with 2.0.1. I did not tried 2.1 but
checked the code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )