@@ -6,10 +6,7 @@ use ironrdp_pdu::{
6
6
cast_length,
7
7
cursor:: { ReadCursor , WriteCursor } ,
8
8
ensure_fixed_part_size, ensure_size, invalid_message_err, unsupported_pdu_err,
9
- utils:: {
10
- checked_sum, checked_sum_or_panic, encoded_str_len, read_string_from_cursor, write_string_to_cursor,
11
- CharacterSet ,
12
- } ,
9
+ utils:: { checked_sum, encoded_str_len, read_string_from_cursor, strict_sum, write_string_to_cursor, CharacterSet } ,
13
10
PduDecode , PduEncode , PduError , PduResult ,
14
11
} ;
15
12
use ironrdp_svc:: SvcPduEncode ;
@@ -354,7 +351,7 @@ impl DataFirstPdu {
354
351
}
355
352
356
353
fn size ( & self ) -> usize {
357
- checked_sum_or_panic ( & [
354
+ strict_sum ( & [
358
355
Header :: size ( ) ,
359
356
self . header . cb_id . size_of_val ( ) ,
360
357
self . header . sp . size_of_val ( ) ,
@@ -473,7 +470,7 @@ impl DataPdu {
473
470
}
474
471
475
472
fn size ( & self ) -> usize {
476
- checked_sum_or_panic ( & [
473
+ strict_sum ( & [
477
474
Header :: size ( ) ,
478
475
self . header . cb_id . size_of_val ( ) , // ChannelId
479
476
self . data . len ( ) , // Data
@@ -524,14 +521,14 @@ impl CreateResponsePdu {
524
521
}
525
522
526
523
fn headerless_size ( header : & Header ) -> usize {
527
- checked_sum_or_panic ( & [
524
+ strict_sum ( & [
528
525
header. cb_id . size_of_val ( ) , // ChannelId
529
526
CreationStatus :: size ( ) , // CreationStatus
530
527
] )
531
528
}
532
529
533
530
fn size ( & self ) -> usize {
534
- checked_sum_or_panic ( & [ Header :: size ( ) , Self :: headerless_size ( & self . header ) ] )
531
+ strict_sum ( & [ Header :: size ( ) , Self :: headerless_size ( & self . header ) ] )
535
532
}
536
533
}
537
534
@@ -606,7 +603,7 @@ impl ClosePdu {
606
603
}
607
604
608
605
fn size ( & self ) -> usize {
609
- checked_sum_or_panic ( & [ Header :: size ( ) , Self :: headerless_size ( & self . header ) ] )
606
+ strict_sum ( & [ Header :: size ( ) , Self :: headerless_size ( & self . header ) ] )
610
607
}
611
608
}
612
609
@@ -840,7 +837,7 @@ impl CreateRequestPdu {
840
837
}
841
838
842
839
fn size ( & self ) -> usize {
843
- checked_sum_or_panic ( & [
840
+ strict_sum ( & [
844
841
Header :: size ( ) ,
845
842
Self :: headerless_fixed_part_size ( & self . header ) , // ChannelId
846
843
encoded_str_len ( & self . channel_name , CharacterSet :: Ansi , true ) , // ChannelName + Null terminator
0 commit comments