yeslogic / fontconfig-rs

Safe wrapper around freedesktop.org's fontconfig library, for locating fonts on UNIX like systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

consider moving away from the unmaintained const-cstr crate.

plugwash opened this issue · comments

According to RUSTSEC-2023-0020 the const-cstr crate is abandoned and has soundness issues. It also performs a redundant null check every time a const_cstr is converted to a cstr, i'm not sure if the optimiser is smart enough to optimise away said check. The soundness issues seem pretty theoretical but still it seems like it would be a good idea to move away from said crate.

The cstr crate is able to construct real const cstrs with compile time checking, but unfortunately doing so requires at least rustc 1.64, i'm not sure what your MSRV policy is and whether that is appropriate. Alternatively you could use the unsafe function from_bytes_with_nul_unchecked directly which has been const since rustc 1.59.

@wezm @manuel-rhdt @brendanzab @adrianwong , any objection to setting MSRV to 1.64 ?