|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62352 AMQP Message body is not binary safe in PHP Land
Submitted: 2012-06-18 15:49 UTC Modified: 2012-06-19 19:24 UTC
From: Assigned: jpauli (profile)
Status: Closed Package: amqp (PECL)
PHP Version: 5.3.14 OS: *
Private report: No CVE-ID: None
 [2012-06-18 15:49 UTC]
AMQPEnveloppe#body is not binary safe, so it cant contain NULL byte, which is 
embarrassing when you deal with PHP serialization format which may contain NULL 
bytes aka : a serialized object

Test script:

class Foo { private $bar="bar"; }

$c = new AMQPConnection(/* params */);
$channel = new AMQPChannel($c);

$ex = new AMQPExchange($channel);
$ex->publish(serialize(new Foo), 'test');

$q = new AMQPQueue($channel);

Expected result:
string(39) "O:3:"Foo":1:{s:8:"Foobar";s:3:"bar";}"

Actual result:
The result gets truncated at the first NULL byte met, thus the unserialize() will 

string(18) "O:3:"Foo":1:{s:8:""


Make-enveloppe-body-binary-safe (last revision 2012-06-18 15:50 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-18 15:50 UTC]
The following patch has been added/updated:

Patch Name: Make-enveloppe-body-binary-safe
Revision:   1340034653
 [2012-06-18 23:06 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jpauli
 [2012-06-19 10:13 UTC]
Related to #62352
 [2012-06-19 19:24 UTC]
Automatic comment from SVN on behalf of pdezwart
Log: Bug #62352  AMQP Message body is not binary safe in PHP Land
 [2012-06-19 19:24 UTC]
-Status: Assigned +Status: Closed
 [2012-06-19 19:24 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Fixed in trunk @ r326257. Thanks!
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 12 19:01:29 2024 UTC