immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.81k stars 220 forks source link

analyze: handle void* casts in arguments of memcpy and related functions #983

Open spernsteiner opened 1 year ago

spernsteiner commented 1 year ago

Unsupported casts to void are a major source of analysis failures on lighttpd. In many of these cases, the resulting void is passed to memcpy or a similar libc function. Most of these have a straightforward safe replacement that eliminates the cast:

Similar rewrites apply for non-slice pointers, such as *dest = (*src).clone() for memcpy.