mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-15 17:31:56 +00:00
handle possibly invalid data: origin_data == nullptr
This commit is contained in:
@@ -334,6 +334,7 @@ bool DictBase::SearchData(std::vector<std::string> &SearchWords, guint32 idxitem
|
||||
|
||||
if (dictfile)
|
||||
fseek(dictfile, idxitem_offset, SEEK_SET);
|
||||
THROW_IF_ERROR(origin_data != nullptr);
|
||||
if (dictfile) {
|
||||
const size_t nitems = fread(origin_data, idxitem_size, 1, dictfile);
|
||||
THROW_IF_ERROR(nitems == 1);
|
||||
|
||||
Reference in New Issue
Block a user