File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 8
8
* Dropped deprecated ` CardProfileInfo2 ` introspection alias.
9
9
* Added ` set_corked_state() ` method to ` Stream ` providing an alternative to using ` cork() ` and
10
10
` uncork() ` .
11
+ * Added length checks to the ` set_prop_int_array() ` and ` set_prop_string_array() ` methods of
12
+ ` format::Info ` . Now should you happen to pass in an array with a length larger than can fit
13
+ within the ` len ` parameter of the C function, it will panic.
11
14
12
15
# 2.29.0 (March 3rd, 2025)
13
16
Original file line number Diff line number Diff line change @@ -497,7 +497,10 @@ impl Info {
497
497
}
498
498
499
499
/// Sets a property with a list of integer values.
500
+ ///
501
+ /// Panics if length of array is larger than `i32::MAX`.
500
502
pub fn set_prop_int_array ( & mut self , key : & str , values : & [ i32 ] ) {
503
+ assert ! ( values. len( ) <= i32 :: MAX as u32 ) ;
501
504
// Warning: New CStrings will be immediately freed if not bound to a variable, leading to
502
505
// as_ptr() giving dangling pointers!
503
506
let c_key = CString :: new ( key) . unwrap ( ) ;
@@ -525,7 +528,10 @@ impl Info {
525
528
}
526
529
527
530
/// Sets a property with a list of string values.
531
+ ///
532
+ /// Panics if length of array is larger than `i32::MAX`.
528
533
pub fn set_prop_string_array ( & mut self , key : & str , values : & [ & str ] ) {
534
+ assert ! ( values. len( ) <= i32 :: MAX as u32 ) ;
529
535
// Warning: New CStrings will be immediately freed if not bound to a variable, leading to
530
536
// as_ptr() giving dangling pointers!
531
537
let c_key = CString :: new ( key) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments