diff options
author | Reuben Thomas <rrt@sc3d.org> | 2017-12-08 15:34:21 +0000 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2017-12-08 15:34:47 +0000 |
commit | 62dd1f24ef08e2f3e4bc9b15d9a48acc7c88d650 (patch) | |
tree | b402a5b31bcb1e964f03bd77bc1b8531ab37b87a /providers | |
parent | 33b37d6ec7b50060779f9d56c4bddb4e7fbfd18d (diff) | |
download | enchant-62dd1f24ef08e2f3e4bc9b15d9a48acc7c88d650.tar.gz |
Fix #170: potential null pointer dereference
Diffstat (limited to 'providers')
-rw-r--r-- | providers/enchant_hspell.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/providers/enchant_hspell.c b/providers/enchant_hspell.c index c7028f1..0e5bbac 100644 --- a/providers/enchant_hspell.c +++ b/providers/enchant_hspell.c @@ -102,6 +102,13 @@ hspell_dict_suggest (EnchantDict * me, const char *const word, gsize length; char *iso_word = g_convert (word, len, "iso8859-8", "utf-8", NULL, &length, NULL); + /* check we got a result */ + if (iso_word == NULL) + { + g_free (iso_word); + return NULL; + } + /* get suggestions */ struct corlist cl; corlist_init (&cl); |