Skip to content

Commit d4a7535

Browse files
authored
chore(iast): add re.match with an index to the leak testing script (#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]>
1 parent 41b9975 commit d4a7535

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/iast/mod_leak_functions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ def test_doit():
7474
re_match = re.compile(r"(\w+)", re.IGNORECASE)
7575
re_match_result = re_match.match(string21) # 1 propagation: 'HIROOT
7676

77-
string22 = re_match_result.group(0) # 1 propagation: '_HIROOT
78-
# string22 = re_match_result.groups()[0]
77+
string22_1 = re_match_result[0] # 1 propagation: '_HIROOT
78+
string22_2 = re_match_result.groups()[0] # 1 propagation: '_HIROOT
79+
string22 = string22_1 + string22_2 # 1 propagation: _HIROOT_HIROOT
7980
tmp_str = "DDDD"
80-
string23 = tmp_str + string22 # 1 propagation: 'DDDD_HIROOT
81+
string23 = tmp_str + string22 # 1 propagation: 'DDDD_HIROOT_HIROOT
8182

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

0 commit comments

Comments
 (0)