I think we should add
"zip_source_keep(lpZipSource);"
before the following line
"auto zip = zip_open_from_source(lpZipSource, 0, &err)"
to avoid crash, due to the internal ref counting of "lpZipSource" variable.
If the ref counting is imbalanced, lpZipSource will be freed by "zip_close(zip);", so the subsequent "zip_source_close(lpZipSource);" will crash or cause memory errors.
hi,
I think we should add
"zip_source_keep(lpZipSource);"
before the following line"auto zip = zip_open_from_source(lpZipSource, 0, &err)"
to avoid crash, due to the internal ref counting of "lpZipSource" variable.If the ref counting is imbalanced, lpZipSource will be freed by "zip_close(zip);", so the subsequent "zip_source_close(lpZipSource);" will crash or cause memory errors.
please refer to the code: https://github.com/ION28/BLUESPAWN/blob/master/BLUESPAWN-win-client/src/scan/YaraScanner.cpp#L29