Use safe version of dc_get_abs_path.

* src/dc_mimefactory.rs(build_body_file): use safe version of
   dc_get_abs_path() function.
This commit is contained in:
Dmitry Bogatov
2019-09-12 01:22:44 +00:00
parent 477470ff70
commit df47e0ed63

View File

@@ -1289,7 +1289,12 @@ unsafe fn build_body_file(
) as *mut libc::c_void,
);
mime_sub = mailmime_new_empty(content, mime_fields);
mailmime_set_body_file(mime_sub, dc_get_abs_path(context, path_filename));
let abs_path = dc_get_abs_path_safe(context, path_filename)
.as_os_str()
.to_str()
.unwrap()
.strdup();
mailmime_set_body_file(mime_sub, abs_path);
if !ret_file_name_as_sent.is_null() {
*ret_file_name_as_sent = dc_strdup(filename_to_send)
}