You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: replace from_utf8_unchecked with from_utf8 in SQLite column name handling (#4221)
* fix: replace from_utf8_unchecked with from_utf8 in SQLite statement handle
Replace all uses of `from_utf8_unchecked` with safe `from_utf8` in the
SQLite statement handle to fix a soundness issue.
SQLite allows non-UTF-8 column names via its C API, but
`from_utf8_unchecked` assumes valid UTF-8 without checking. This can
produce invalid `&str` values through a safe public API, which is
undefined behavior in Rust.
Using `from_utf8().expect()` instead converts potential UB into a
defined panic with a clear message. There is no behavioral change for
valid UTF-8 inputs, which covers all practical usage.
Fixes#4192
* style: run rustfmt on handle.rs
0 commit comments