You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King III (JIRA)" <ji...@apache.org> on 2018/11/05 13:00:00 UTC
[jira] [Resolved] (THRIFT-4658) Rust's TBinaryInputProtocol fails
when strict is false
[ https://issues.apache.org/jira/browse/THRIFT-4658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James E. King III resolved THRIFT-4658.
---------------------------------------
Resolution: Fixed
Fix Version/s: 1.0
If this gets pulled into the 0.12.0 build branch someone will need to change the "Fix Version/s".
> 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
> Fix For: 1.0
>
>
> 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)