File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ impl RtMessage {
145145 let start_idx = header_end + value_start;
146146 let end_idx = header_end + value_end;
147147
148- if end_idx > msg_end || start_idx > end_idx {
148+ if end_idx > bytes_len || start_idx > end_idx {
149149 return Err ( Error :: InvalidValueLength ( tag, end_idx as u32 ) ) ;
150150 }
151151
@@ -342,6 +342,9 @@ mod test {
342342
343343 // Entire message was read
344344 assert_eq ! ( encoded. position( ) , 72 ) ;
345+
346+ // Round-trip single-tag message
347+ RtMessage :: from_bytes ( & msg. encode ( ) . unwrap ( ) ) . unwrap ( ) ;
345348 }
346349
347350 #[ test]
@@ -392,6 +395,9 @@ mod test {
392395
393396 // Everything was read
394397 assert_eq ! ( encoded. position( ) as usize , msg. encoded_size( ) ) ;
398+
399+ // Round-trip multi-tag message
400+ RtMessage :: from_bytes ( & msg. encode ( ) . unwrap ( ) ) . unwrap ( ) ;
395401 }
396402
397403 #[ test]
You can’t perform that action at this time.
0 commit comments