thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-4658) Rust's TBinaryInputProtocol fails when strict is false
Date Mon, 05 Nov 2018 12:09:00 GMT

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

ASF GitHub Bot commented on THRIFT-4658:
----------------------------------------

allengeorge commented on issue #1620: THRIFT-4658: TBinaryInputProtocol fails when strict
is false
URL: https://github.com/apache/thrift/pull/1620#issuecomment-435852206
 
 
   [puzzled] There appears to be a failure in a sub-build, but it doesn't have to do with
the PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Rust's TBinaryInputProtocol fails when strict is false
> ------------------------------------------------------
>
>                 Key: THRIFT-4658
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4658
>             Project: Thrift
>          Issue Type: Bug
>          Components: Rust - Library
>    Affects Versions: 0.11.0
>         Environment:  
> `rustup show` output:
> Default host: x86_64-apple-darwin
> installed toolchains
> --------------------
> stable-x86_64-apple-darwin
> nightly-x86_64-apple-darwin
> active toolchain
> ----------------
> stable-x86_64-apple-darwin (default)
> rustc 1.30.0 (da5f414c2 2018-10-24)
>            Reporter: J W
>            Assignee: Allen George
>            Priority: Major
>
> When use `TBinaryInputProtocol::new(..., false)`, any trivial example will fail:
> service TestService {
>  bool Test()
> }
>  
> Problem is here:
> [https://github.com/apache/thrift/blob/master/lib/rs/src/protocol/binary.rs#L126]
> with_capacity() allocates space, but len() of resulting Vec<> is 0.  read_exact()
reads 0 bytes and read_byte() below receives first byte of the string which may or may not
convert to TMessageType.
> Change it to:
> let mut name_buf: Vec<u8> = vec![0; name_size];
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message