mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-16 01:41:55 +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)
|
if (dictfile)
|
||||||
fseek(dictfile, idxitem_offset, SEEK_SET);
|
fseek(dictfile, idxitem_offset, SEEK_SET);
|
||||||
|
THROW_IF_ERROR(origin_data != nullptr);
|
||||||
if (dictfile) {
|
if (dictfile) {
|
||||||
const size_t nitems = fread(origin_data, idxitem_size, 1, dictfile);
|
const size_t nitems = fread(origin_data, idxitem_size, 1, dictfile);
|
||||||
THROW_IF_ERROR(nitems == 1);
|
THROW_IF_ERROR(nitems == 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user