THRIFT-5928: fix skip() for binary fields with non-UTF-8 bytes
Client: rs
skip_till_depth() calls read_string() for TType::String fields, which
performs String::from_utf8() and fails on binary fields containing raw
bytes. Since string and binary share the same wire type and skip()
discards the value anyway, use read_bytes() instead.
This is safe because:
- The result is discarded immediately via .map(|_| ())
- read_string() is literally read_bytes() + String::from_utf8()
- Both consume identical wire bytes (4-byte length + N bytes)
- No behavioral change for valid UTF-8 string data
The bug triggers any time a newer schema adds a binary field to a
struct that an older binary is still deserializing — the older binary
hits the skip() path for the unknown field and fails on the raw bytes.
1 file changed