php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59972 Binary bodies are not captured properly
Submitted: 2011-09-27 16:02 UTC Modified: 2011-09-27 16:05 UTC
From: jthijssen at noxlogic dot nl Assigned:
Status: Closed Package: stomp (PECL)
PHP Version: Trunk SVN-2011-09-27 (dev) OS: linux
Private report: No CVE-ID: None
 [2011-09-27 16:02 UTC] jthijssen at noxlogic dot nl
Description:
------------
When reading a stomp message, it doesn't respect the content-length header. It will read until the first \0 byte. This is because of a small bug when adding keys/values to the message-hash.

This results in stomp.c (around line 515) not be able to find the content-length header back, and thus it will read the data until the first \0 byte.



Reproduce code:
---------------
Any message with a \0 inside the message body. 


Patches

stomp.patch (last revision 2011-10-12 12:50 UTC by jthijssen at noxlogic dot nl)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-27 16:05 UTC] jthijssen at noxlogic dot nl
Looks like i cannot add patches, so I'll include a gist to the patch:

https://gist.github.com/1246073
 [2012-11-18 22:05 UTC] pierrick@php.net
-Status: Open +Status: Closed
 [2012-11-18 22:05 UTC] pierrick@php.net
Automatic comment on behalf of pierrick
Revision: http://git.php.net/?p=pecl/tools/stomp.git;a=commit;h=7d61983988c8a893bcf4531432346f11b29e96e2
Log: Fixed bug #59972 - Make body binary safe
 [2013-04-11 20:01 UTC] mi+php at aldan dot algebra dot com
In case of ActiveMQ the unconditional adding of Content-Length header has one undesired effect -- the web-GUI no longer treats message-bodies as displayable:

  https://github.com/meadvillerb/onstomp/issues/19

To work around this, users of ActiveMQ may want to add 'amq-msg-type' => 'text' to the headers.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 13:01:30 2024 UTC