3Hren / 3Hren/msgpack-rust

Potential Bug

Open
#367 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.4k
Forks
162
PR merge metrics
No merged PRs in 30d

Description

In msgpack-rust-master/rmp/src/encode/mod.rs, the comment indicates that function will panic if ty is negative.
```rust
/// # Panics
///
/// Panics if `ty` is negative, because it is reserved for future MessagePack extension including
/// 2-byte type information.
pub fn write_ext_meta(wr: &mut W, len: u32, ty: i8) -> Result> {
```
However, following test will not panic, which is inconsistent with comment.
```rust
#[test]
fn test(){
let mut buf = [0x00, 0x00];
assert_eq!(Marker::FixExt1, write_ext_meta(&mut &mut buf[..], 1, -1).unwrap());
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.