From f9494641a62fec6f4d9f8ebb1a9e526f053361bc Mon Sep 17 00:00:00 2001 From: xomx Date: Wed, 28 May 2025 12:10:51 +0200 Subject: [PATCH] Fix crash when trying to append a word to R/O user dictionary --- src/spellers/HunspellInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/spellers/HunspellInterface.cpp b/src/spellers/HunspellInterface.cpp index 3485f59..c032d9f 100644 --- a/src/spellers/HunspellInterface.cpp +++ b/src/spellers/HunspellInterface.cpp @@ -34,6 +34,8 @@ void append_word_to_user_dictionary(const wchar_t *dictionary_path, const char * return; auto fp = _wfopen(dictionary_path, L"a"); + if (!fp) + return; fprintf(fp, "%s\n", word); fclose(fp); }