Fix segfault on invalid UTF-8 when generating preview

This commit is contained in:
Michael Gratton 2019-10-22 13:07:27 +11:00
parent f6e270f83d
commit 7bac77df7b

View file

@ -248,7 +248,10 @@ public string to_preview_text(string? text, TextFormat format) {
preview = Geary.HTML.html_to_text(text, false);
}
return Geary.String.reduce_whitespace(preview);
// XXX really shouldn't have to call make_valid here but do so to
// avoid segfaults in the regex engine on invalid char data. See
// issue #186 for the proper fix.
return Geary.String.reduce_whitespace(preview.make_valid());
}
/**