We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ce57a1 commit 1b21bbcCopy full SHA for 1b21bbc
src/error.rs
@@ -34,6 +34,9 @@ pub enum Error {
34
/// Offset within message was not 32-bit aligned
35
InvalidOffsetAlignment(u32),
36
37
+ /// Invalid number of tags specified
38
+ InvalidNumTags(u32),
39
+
40
/// Otherwise invalid request
41
InvalidRequest,
42
}
src/message.rs
@@ -47,6 +47,10 @@ impl RtMessage {
47
let mut msg = Cursor::new(bytes);
48
49
let num_tags = msg.read_u32::<LittleEndian>()?;
50
+ if num_tags == 0 {
51
+ return Err(Error::InvalidNumTags(0));
52
+ }
53
54
let mut rt_msg = RtMessage::new(num_tags);
55
56
if num_tags == 1 {
0 commit comments