mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 04:32:19 +08:00
Do not assume sqlite3_column_text
is valid UTF-8.
Fix Statement::value_ref
This commit is contained in:
@@ -622,10 +622,7 @@ impl Statement<'_> {
|
||||
CStr::from_ptr(text as *const c_char)
|
||||
};
|
||||
|
||||
// sqlite3_column_text returns UTF8 data, so our unwrap here should be fine.
|
||||
let s = s
|
||||
.to_str()
|
||||
.expect("sqlite3_column_text returned invalid UTF-8");
|
||||
let s = s.to_bytes();
|
||||
ValueRef::Text(s)
|
||||
}
|
||||
ffi::SQLITE_BLOB => {
|
||||
|
Reference in New Issue
Block a user