Skip to content

Commit

Permalink
fix bug in parsing message size
Browse files Browse the repository at this point in the history
  • Loading branch information
Calsign committed Feb 22, 2024
1 parent 0fb037b commit 36ecd00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust_parser/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn main() -> Result<(), Box<dyn Error>> {
}
res => res?,
}
let size = CodedInputStream::from_bytes(&buf[..SF32]).read_uint32()? as usize;
let size = CodedInputStream::from_bytes(&buf[..SF32]).read_sfixed32()? as usize;
if size > buf.len() {
// grow buffer as needed
buf = vec![0; size];
Expand Down

0 comments on commit 36ecd00

Please sign in to comment.