@@ -5030,8 +5030,9 @@ void Executor::terminateStateOnTargetError(ExecutionState &state,
5030
5030
void Executor::terminateStateOnTargetTaintError (ExecutionState &state,
5031
5031
uint64_t hits, size_t sink) {
5032
5032
std::string error = " Taint error:" ;
5033
- const auto &sinkData = annotationsData.taintAnnotation .hits .at (sink);
5034
- for (size_t source = 0 ; source < annotationsData.taintAnnotation .sources .size (); source++) {
5033
+ const auto &sinkData = annotationsData.taintAnnotation .hits [sink];
5034
+ for (size_t source = 0 ;
5035
+ source < annotationsData.taintAnnotation .sources .size (); source++) {
5035
5036
if ((hits >> source) & 1u ) {
5036
5037
error += " " + annotationsData.taintAnnotation .rules [sinkData.at (source)];
5037
5038
}
@@ -5041,8 +5042,8 @@ void Executor::terminateStateOnTargetTaintError(ExecutionState &state,
5041
5042
state, ReachWithError (ReachWithErrorType::MaybeTaint, error));
5042
5043
5043
5044
terminateStateOnProgramError (
5044
- state, new ErrorEvent ( locationOf (state), StateTerminationType::Taint,
5045
- error));
5045
+ state,
5046
+ new ErrorEvent ( locationOf (state), StateTerminationType::Taint, error));
5046
5047
}
5047
5048
5048
5049
void Executor::terminateStateOnError (ExecutionState &state,
@@ -5550,6 +5551,8 @@ void Executor::executeChangeTaintSource(ExecutionState &state,
5550
5551
ref<PointerExpr> address,
5551
5552
uint64_t source, bool isAdd) {
5552
5553
address = optimizer.optimizeExpr (address, true );
5554
+ ref<PointerExpr> base = PointerExpr::create (
5555
+ address->getBase (), address->getBase (), address->getTaint ());
5553
5556
ref<Expr> isNullPointer = Expr::createIsZero (address->getValue ());
5554
5557
StatePair zeroPointer =
5555
5558
forkInternal (state, isNullPointer, BranchType::ResolvePointer);
@@ -5562,8 +5565,8 @@ void Executor::executeChangeTaintSource(ExecutionState &state,
5562
5565
}
5563
5566
if (zeroPointer.second ) { // address != 0
5564
5567
ExactResolutionList rl;
5565
- resolveExact (*zeroPointer.second , address ,
5566
- typeSystemManager-> getUnknownType (), rl, " сhangeTaintSource" );
5568
+ resolveExact (*zeroPointer.second , base, typeSystemManager-> getUnknownType () ,
5569
+ rl, " сhangeTaintSource" );
5567
5570
for (Executor::ExactResolutionList::iterator it = rl.begin (), ie = rl.end ();
5568
5571
it != ie; ++it) {
5569
5572
const MemoryObject *mo = it->first ;
@@ -5589,6 +5592,8 @@ void Executor::executeCheckTaintSource(ExecutionState &state,
5589
5592
ref<PointerExpr> address,
5590
5593
uint64_t source) {
5591
5594
address = optimizer.optimizeExpr (address, true );
5595
+ ref<PointerExpr> base = PointerExpr::create (
5596
+ address->getBase (), address->getBase (), address->getTaint ());
5592
5597
ref<Expr> isNullPointer = Expr::createIsZero (address->getValue ());
5593
5598
StatePair zeroPointer =
5594
5599
forkInternal (state, isNullPointer, BranchType::ResolvePointer);
@@ -5601,8 +5606,8 @@ void Executor::executeCheckTaintSource(ExecutionState &state,
5601
5606
}
5602
5607
if (zeroPointer.second ) {
5603
5608
ExactResolutionList rl;
5604
- resolveExact (*zeroPointer.second , address ,
5605
- typeSystemManager-> getUnknownType (), rl, " checkTaintSource" );
5609
+ resolveExact (*zeroPointer.second , base, typeSystemManager-> getUnknownType () ,
5610
+ rl, " checkTaintSource" );
5606
5611
5607
5612
for (Executor::ExactResolutionList::iterator it = rl.begin (), ie = rl.end ();
5608
5613
it != ie; ++it) {
@@ -5629,6 +5634,8 @@ void Executor::executeGetTaintHits(ExecutionState &state,
5629
5634
}
5630
5635
5631
5636
address = optimizer.optimizeExpr (address, true );
5637
+ ref<PointerExpr> base = PointerExpr::create (
5638
+ address->getBase (), address->getBase (), address->getTaint ());
5632
5639
ref<Expr> isNullPointer = Expr::createIsZero (address->getValue ());
5633
5640
StatePair zeroPointer =
5634
5641
forkInternal (state, isNullPointer, BranchType::ResolvePointer);
@@ -5641,8 +5648,8 @@ void Executor::executeGetTaintHits(ExecutionState &state,
5641
5648
}
5642
5649
if (zeroPointer.second ) {
5643
5650
ExactResolutionList rl;
5644
- resolveExact (*zeroPointer.second , address ,
5645
- typeSystemManager-> getUnknownType (), rl, " getTaintHits" );
5651
+ resolveExact (*zeroPointer.second , base, typeSystemManager-> getUnknownType () ,
5652
+ rl, " getTaintHits" );
5646
5653
5647
5654
for (Executor::ExactResolutionList::iterator it = rl.begin (), ie = rl.end ();
5648
5655
it != ie; ++it) {
0 commit comments