Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Sep 29, 2025

If the source line had square brackets before the match, the stripping
of the banned function left the original line intact, and repeated the
check on it forever. E.g. with banned function open in lib518.c:

t518_testfd[0] = open(DEV_NULL, O_RDONLY);

If the source line had square brackets before the match, the stripping
of the banned function left the original line intact, and repeated the
check on it forever. E.g. with `open` banned function in `lib518.c`:
```
t518_testfd[0] = open(DEV_NULL, O_RDONLY);
```
@vszakats vszakats closed this in dd37d69 Sep 30, 2025
@vszakats vszakats deleted the chksrcloop branch September 30, 2025 09:33
vszakats added a commit that referenced this pull request Oct 4, 2025
By quoting the search expression to be replaced. This avoid the issue
when the code leading up to a banned function contained regex characters
that the script did not explicitly handle, e.g. `+`.

Assisted-by: Daniel Stenberg

Ref: https://perldoc.perl.org/functions/quotemeta
Follow-up to dd37d69 #18775

Closes #18845
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant