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.
2 parents 7372ed6 + d0d9de2 commit 8f83c58Copy full SHA for 8f83c58
library/core/src/ffi/c_str.rs
@@ -948,6 +948,19 @@ mod verify {
948
assert!(c_str.is_safe());
949
}
950
951
+ #[kani::proof]
952
+ #[kani::unwind(17)]
953
+ fn check_from_bytes_with_nul() {
954
+ const MAX_SIZE: usize = 16;
955
+ let string: [u8; MAX_SIZE] = kani::any();
956
+ let slice = kani::slice::any_slice_of_array(&string);
957
+
958
+ let result = CStr::from_bytes_with_nul(slice);
959
+ if let Ok(c_str) = result {
960
+ assert!(c_str.is_safe());
961
+ }
962
963
964
// pub const fn count_bytes(&self) -> usize
965
#[kani::proof]
966
#[kani::unwind(32)]
0 commit comments