mirror of
https://github.com/chatmail/core.git
synced 2026-04-20 23:16:30 +03:00
With this change, passing invalid utf8 string to `dc_send_text_msg' does not crash application, it prints warning and returns error code. It should be admitted that this fix is sub-optimal: if input C string is valid utf8 (which is likely), result of successful conversion to `&str' is discarded in `dc_send_text_msg', and the same input C string is converted again with `as_str' in `prepare_msg_raw'. It is not clear how to fix it in non-disruptive way, since input C string is passed down to call stack as part of `dc_msg_t' struct, which is part of C ABI.