Skip to content

Commit

Permalink
Foxhound: tainting StringBuffer before String creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbrbr committed Feb 24, 2024
1 parent 70c41d5 commit c4e29ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/src/builtin/String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3688,18 +3688,18 @@ static JSString* ReplaceAll(JSContext* cx, JSLinearString* string,
return nullptr;
}

// Step 16.
auto* resultString = result.finishString();
if (!resultString) {
return nullptr;
}

// Taintfox: extend the taint flow
if(result.taint().hasTaint()) {
result.taint().extend(
TaintOperationFromContextJSString(cx, "replaceAll", true, searchString, replaceString));
}

// Step 16.
auto* resultString = result.finishString();
if (!resultString) {
return nullptr;
}

return resultString;
}

Expand Down

0 comments on commit c4e29ad

Please sign in to comment.