Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce .unwrap() in libvoikko.rs #2

Open
ronjakoi opened this issue Feb 5, 2019 · 0 comments
Open

Reduce .unwrap() in libvoikko.rs #2

ronjakoi opened this issue Feb 5, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@ronjakoi
Copy link
Owner

ronjakoi commented Feb 5, 2019

The functions in libvoikko.rs do a lot of stuff with ffi::{CStr, CString} and use .unwrap() while doing it. .unwrap() will panic on error, which can cause stack unwinding. Stack unwinding across the FFI boundary causes undefined behavior.

So, these results need to be actually checked and the results propagated in a controlled way. Maybe we need to introduce something like a StringError in the voikko module, unless we want to return something like Result<String, ffi::IntoStringError> across our API...

@ronjakoi ronjakoi added the enhancement New feature or request label Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant