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 c5bcc50 commit e0d15dcCopy full SHA for e0d15dc
src/message.rs
@@ -70,6 +70,10 @@ impl RtMessage {
70
71
/// Internal function to create a single tag message
72
fn single_tag_message(bytes: &[u8], msg: &mut Cursor<&[u8]>) -> Result<Self, Error> {
73
+ if bytes.len() < 8 {
74
+ return Err(Error::MessageTooShort);
75
+ }
76
+
77
let pos = msg.position() as usize;
78
msg.set_position((pos + 4) as u64);
79
@@ -80,7 +84,7 @@ impl RtMessage {
80
84
let mut rt_msg = RtMessage::new(1);
81
85
rt_msg.add_field(tag, &value)?;
82
86
83
- return Ok(rt_msg);
87
+ Ok(rt_msg)
88
}
89
90
/// Internal function to create a multiple tag message
0 commit comments