Only occurs if Paranoid mode is set in clamd.conf, or unsigned and signed
bytecode are loaded together in --enable-unsigned-bytecode mode.
... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Mon Jan 10 23:51:08 EET 2011 (edwin) |
|
2 |
+------------------------------------ |
|
3 |
+ * libclamav/c++/ClamBCRTChecks.cpp: fix paranoid mode crash (bb #2434). |
|
4 |
+ |
|
1 | 5 |
Mon Jan 10 18:43:02 CET 2011 (tk) |
2 | 6 |
--------------------------------- |
3 | 7 |
* sigtool: improve handling of spaces in cdiffs (bb#2090) |
... | ... |
@@ -117,8 +117,16 @@ namespace { |
117 | 117 |
|
118 | 118 |
std::vector<Instruction*> insns; |
119 | 119 |
|
120 |
+ BasicBlock *LastBB = 0; |
|
121 |
+ bool skip = false; |
|
120 | 122 |
for (inst_iterator I=inst_begin(F),E=inst_end(F); I != E;++I) { |
121 | 123 |
Instruction *II = &*I; |
124 |
+ if (II->getParent() != LastBB) { |
|
125 |
+ LastBB = II->getParent(); |
|
126 |
+ skip = DT->getNode(LastBB) == 0; |
|
127 |
+ } |
|
128 |
+ if (skip) |
|
129 |
+ continue; |
|
122 | 130 |
if (isa<LoadInst>(II) || isa<StoreInst>(II) || isa<MemIntrinsic>(II)) |
123 | 131 |
insns.push_back(II); |
124 | 132 |
if (CallInst *CI = dyn_cast<CallInst>(II)) { |