servo / core-foundation-rs

Rust bindings to Core Foundation and other low level libraries on Mac OS X and iOS
Other
987 stars 216 forks source link

Avoid UB if the CFData pointer is NULL #688

Closed kornelski closed 1 month ago

kornelski commented 1 month ago

There's no guarantee that CFDataGetBytePtr will return a non-NULL pointer, and therefore creating a slice from it can be Undefined Behavior in Rust.

https://github.com/kornelski/rust-security-framework/issues/206