Content length on stomp messages

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Content length on stomp messages

John D. Ament-2
Hey guys!

Following up on a conversation was having on github via stomp messages.

I think we do have a bug with the content length, where we can try to read
larger than the message.

https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java#L230

If I'm reading this right, if the content length is manually set to 1000
and there's only 200 bytes we might be trying to get 1000.  Not sure what
will happen, does it read into the next message?

John
Reply | Threaded
Open this post in threaded view
|

Re: Content length on stomp messages

chirino
if content length is 1000, then the message body should be 1000 bytes.
If the frame has less then that it's an error on the sending side of
the protocol encoder

On Mon, Jul 20, 2015 at 12:57 PM, John D. Ament <[hidden email]> wrote:

> Hey guys!
>
> Following up on a conversation was having on github via stomp messages.
>
> I think we do have a bug with the content length, where we can try to read
> larger than the message.
>
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java#L230
>
> If I'm reading this right, if the content length is manually set to 1000
> and there's only 200 bytes we might be trying to get 1000.  Not sure what
> will happen, does it read into the next message?
>
> John



--
Hiram Chirino
Engineering | Red Hat, Inc.
[hidden email] | fusesource.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino
Reply | Threaded
Open this post in threaded view
|

Re: Content length on stomp messages

John D. Ament
What you're saying is true, but it's also indicative of a potential
overflow issue.

John

On Wed, Aug 26, 2015 at 6:16 PM Hiram Chirino <[hidden email]>
wrote:

> if content length is 1000, then the message body should be 1000 bytes.
> If the frame has less then that it's an error on the sending side of
> the protocol encoder
>
> On Mon, Jul 20, 2015 at 12:57 PM, John D. Ament <[hidden email]>
> wrote:
> > Hey guys!
> >
> > Following up on a conversation was having on github via stomp messages.
> >
> > I think we do have a bug with the content length, where we can try to
> read
> > larger than the message.
> >
> >
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java#L230
> >
> > If I'm reading this right, if the content length is manually set to 1000
> > and there's only 200 bytes we might be trying to get 1000.  Not sure what
> > will happen, does it read into the next message?
> >
> > John
>
>
>
> --
> Hiram Chirino
> Engineering | Red Hat, Inc.
> [hidden email] | fusesource.com | redhat.com
> skype: hiramchirino | twitter: @hiramchirino
>
Reply | Threaded
Open this post in threaded view
|

Re: Content length on stomp messages

clebertsuconic
I'm confused if there is an issue or not?

If there is can u send a fix ? :)

-- Clebert Suconic typing on the iPhone.

> On Aug 26, 2015, at 18:22, John D. Ament <[hidden email]> wrote:
>
> What you're saying is true, but it's also indicative of a potential
> overflow issue.
>
> John
>
> On Wed, Aug 26, 2015 at 6:16 PM Hiram Chirino <[hidden email]>
> wrote:
>
>> if content length is 1000, then the message body should be 1000 bytes.
>> If the frame has less then that it's an error on the sending side of
>> the protocol encoder
>>
>> On Mon, Jul 20, 2015 at 12:57 PM, John D. Ament <[hidden email]>
>> wrote:
>>> Hey guys!
>>>
>>> Following up on a conversation was having on github via stomp messages.
>>>
>>> I think we do have a bug with the content length, where we can try to
>> read
>>> larger than the message.
>> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java#L230
>>>
>>> If I'm reading this right, if the content length is manually set to 1000
>>> and there's only 200 bytes we might be trying to get 1000.  Not sure what
>>> will happen, does it read into the next message?
>>>
>>> John
>>
>>
>>
>> --
>> Hiram Chirino
>> Engineering | Red Hat, Inc.
>> [hidden email] | fusesource.com | redhat.com
>> skype: hiramchirino | twitter: @hiramchirino
>>
Reply | Threaded
Open this post in threaded view
|

Re: Content length on stomp messages

John D. Ament-2
I think there is.  This came up in a PR that we were discussing a month
ago, finally got a response today ;-)

I'll take a look in a day or two, has been a hectic work schedule lately.

John

On Wed, Aug 26, 2015 at 9:02 PM Clebert <[hidden email]> wrote:

> I'm confused if there is an issue or not?
>
> If there is can u send a fix ? :)
>
> -- Clebert Suconic typing on the iPhone.
>
> > On Aug 26, 2015, at 18:22, John D. Ament <[hidden email]> wrote:
> >
> > What you're saying is true, but it's also indicative of a potential
> > overflow issue.
> >
> > John
> >
> > On Wed, Aug 26, 2015 at 6:16 PM Hiram Chirino <[hidden email]>
> > wrote:
> >
> >> if content length is 1000, then the message body should be 1000 bytes.
> >> If the frame has less then that it's an error on the sending side of
> >> the protocol encoder
> >>
> >> On Mon, Jul 20, 2015 at 12:57 PM, John D. Ament <[hidden email]>
> >> wrote:
> >>> Hey guys!
> >>>
> >>> Following up on a conversation was having on github via stomp messages.
> >>>
> >>> I think we do have a bug with the content length, where we can try to
> >> read
> >>> larger than the message.
> >>
> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java#L230
> >>>
> >>> If I'm reading this right, if the content length is manually set to
> 1000
> >>> and there's only 200 bytes we might be trying to get 1000.  Not sure
> what
> >>> will happen, does it read into the next message?
> >>>
> >>> John
> >>
> >>
> >>
> >> --
> >> Hiram Chirino
> >> Engineering | Red Hat, Inc.
> >> [hidden email] | fusesource.com | redhat.com
> >> skype: hiramchirino | twitter: @hiramchirino
> >>
>
Reply | Threaded
Open this post in threaded view
|

Re: Content length on stomp messages

chirino
In reply to this post by John D. Ament
Can you explain the overflow issue?

On Wed, Aug 26, 2015 at 6:22 PM, John D. Ament <[hidden email]> wrote:

> What you're saying is true, but it's also indicative of a potential
> overflow issue.
>
> John
>
> On Wed, Aug 26, 2015 at 6:16 PM Hiram Chirino <[hidden email]>
> wrote:
>
>> if content length is 1000, then the message body should be 1000 bytes.
>> If the frame has less then that it's an error on the sending side of
>> the protocol encoder
>>
>> On Mon, Jul 20, 2015 at 12:57 PM, John D. Ament <[hidden email]>
>> wrote:
>> > Hey guys!
>> >
>> > Following up on a conversation was having on github via stomp messages.
>> >
>> > I think we do have a bug with the content length, where we can try to
>> read
>> > larger than the message.
>> >
>> >
>> https://github.com/apache/activemq-artemis/blob/master/artemis-protocols/artemis-stomp-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/stomp/StompDecoder.java#L230
>> >
>> > If I'm reading this right, if the content length is manually set to 1000
>> > and there's only 200 bytes we might be trying to get 1000.  Not sure what
>> > will happen, does it read into the next message?
>> >
>> > John
>>
>>
>>
>> --
>> Hiram Chirino
>> Engineering | Red Hat, Inc.
>> [hidden email] | fusesource.com | redhat.com
>> skype: hiramchirino | twitter: @hiramchirino
>>



--
Hiram Chirino
Engineering | Red Hat, Inc.
[hidden email] | fusesource.com | redhat.com
skype: hiramchirino | twitter: @hiramchirino