You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jake Farrell (JIRA)" <ji...@apache.org> on 2014/03/18 06:19:43 UTC

[jira] [Commented] (THRIFT-2351) PHP TCompactProtocol has fails to decode messages

    [ https://issues.apache.org/jira/browse/THRIFT-2351?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13938832#comment-13938832 ] 

Jake Farrell commented on THRIFT-2351:
--------------------------------------

[~roger.meier] anything left on this?

> PHP TCompactProtocol has fails to decode messages
> -------------------------------------------------
>
>                 Key: THRIFT-2351
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2351
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.9.1
>         Environment: Tested under PHP 5.3 and HHVM latest.
>            Reporter: Paul Banks
>            Assignee: Roger Meier
>              Labels: easyfix
>         Attachments: THRIFT-2351-fix-php-compact-decoding.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> There are two typos in TCompactProtocol::readMessageBegin that prevent correct decoding of any message. They are on consecutive lines:
> https://github.com/apache/thrift/blob/master/lib/php/lib/Thrift/Protocol/TCompactProtocol.php#L390-L391
> First $seqId does not match case of argument $seqid so this is not set PHP is not case sensitive for class names but IS for variable names.
> Second and more importantly, on the following line $name has the decoded length assigned to it instead of $result. This means the method name "hello" ends up being decoded as "6" (the length of the string plus length prefix) and hence any processor trying to dispatch the event will fail.
> I can submit a patch/pull request but its only 6 chars to change and clearly there are no automated tests for this protocol implementation as that should have been caught before.
> I guess not many other people are using PHP as a thrift service processor with this protocol.



--
This message was sent by Atlassian JIRA
(v6.2#6252)