Make cb_set_config() safe

This commit is contained in:
Alexander Krotov
2019-07-30 02:43:39 +03:00
parent 9314a5a8fd
commit f87c98d6ea
3 changed files with 4 additions and 16 deletions

View File

@@ -233,13 +233,8 @@ unsafe fn cb_precheck_imf(
return rfc724_mid_exists;
}
unsafe fn cb_set_config(context: &Context, key: *const libc::c_char, value: *const libc::c_char) {
let v = if value.is_null() {
None
} else {
Some(as_str(value))
};
context.sql.set_config(context, as_str(key), v).ok();
fn cb_set_config(context: &Context, key: &str, value: Option<&str>) {
context.sql.set_config(context, key, value).ok();
}
/* *