You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Kevin Radloff (JIRA)" <ji...@apache.org> on 2013/02/07 19:13:12 UTC

[jira] [Commented] (THRIFT-1698) BaseTransport is missing nil check in read_all

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

Kevin Radloff commented on THRIFT-1698:
---------------------------------------

Anyone care to give any traction to this? To give some more background, this causes a "undefined method `length' for nil:NilClass" in #read_all when an empty string is passed into an IOStreamTransport because #read will return nil. It seems like the standard 'no version identifier' error would be much better than calling a method on a nil object.

I can put up a better patch with some tests if that would help.
                
> BaseTransport is missing nil check in read_all
> ----------------------------------------------
>
>                 Key: THRIFT-1698
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1698
>             Project: Thrift
>          Issue Type: Bug
>          Components: Ruby - Library
>    Affects Versions: 0.8
>            Reporter: Kevin Radloff
>            Priority: Minor
>         Attachments: thrift.diff
>
>
> The code in BaseTransport#read_all does not check that the return value from #read is non-nil. I haven't checked all the transport classes, but I know this is possible from the IOStreamTransport. Either #read_all needs a nil check, or transport classes need to be modified to never return nil from their #read methods.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira