Fix paranoid mode crash (bb #2434).

Only occurs if Paranoid mode is set in clamd.conf, or unsigned and signed
bytecode are loaded together in --enable-unsigned-bytecode mode.
This commit is contained in:
Török Edvin
2011-01-10 23:51:32 +02:00
parent 0dbc437202
commit bc0ef08bb7
2 changed files with 12 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
Mon Jan 10 23:51:08 EET 2011 (edwin)
------------------------------------
* libclamav/c++/ClamBCRTChecks.cpp: fix paranoid mode crash (bb #2434).
Mon Jan 10 18:43:02 CET 2011 (tk)
---------------------------------
* sigtool: improve handling of spaces in cdiffs (bb#2090)

View File

@@ -117,8 +117,16 @@ namespace {
std::vector<Instruction*> insns;
BasicBlock *LastBB = 0;
bool skip = false;
for (inst_iterator I=inst_begin(F),E=inst_end(F); I != E;++I) {
Instruction *II = &*I;
if (II->getParent() != LastBB) {
LastBB = II->getParent();
skip = DT->getNode(LastBB) == 0;
}
if (skip)
continue;
if (isa<LoadInst>(II) || isa<StoreInst>(II) || isa<MemIntrinsic>(II))
insns.push_back(II);
if (CallInst *CI = dyn_cast<CallInst>(II)) {