Skip to content

Commit

Permalink
chore(iast): add re.match with an index to the leak testing script (#…
Browse files Browse the repository at this point in the history
…10742)

## Checklist
- [X] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [ ] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

Signed-off-by: Juanjo Alvarez <[email protected]>
  • Loading branch information
juanjux authored Sep 23, 2024
1 parent 41b9975 commit d4a7535
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/iast/mod_leak_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ def test_doit():
re_match = re.compile(r"(\w+)", re.IGNORECASE)
re_match_result = re_match.match(string21) # 1 propagation: 'HIROOT

string22 = re_match_result.group(0) # 1 propagation: '_HIROOT
# string22 = re_match_result.groups()[0]
string22_1 = re_match_result[0] # 1 propagation: '_HIROOT
string22_2 = re_match_result.groups()[0] # 1 propagation: '_HIROOT
string22 = string22_1 + string22_2 # 1 propagation: _HIROOT_HIROOT
tmp_str = "DDDD"
string23 = tmp_str + string22 # 1 propagation: 'DDDD_HIROOT
string23 = tmp_str + string22 # 1 propagation: 'DDDD_HIROOT_HIROOT

re_match = re.compile(r"(\w+)(_+)(\w+)", re.IGNORECASE)
re_match_result = re_match.search(string23)
Expand Down

0 comments on commit d4a7535

Please sign in to comment.