Skip to content

correct handling result of CPTRetriveNode - #3447

Merged
airween merged 1 commit into
owasp-modsecurity:v3/masterfrom
chenuduss:v3/master
Oct 28, 2025
Merged

airween merged 1 commit into
owasp-modsecurity:v3/masterfrom
chenuduss:v3/master

Conversation

@chenuduss

Copy link
Copy Markdown
Contributor

what

correct handling result of CPTRetriveNode().

why

Function CPTRetriveNode may return NULL, and null check required

@sonarqubecloud

Copy link
Copy Markdown

@airween

airween commented Oct 24, 2025

Copy link
Copy Markdown
Member

Hi @chenuduss,

thanks for this PR, nice catch.

Just out of curiosity: have you faced any problem in practice with this error?

Or how did you catch it?

Btw: the PR looks good to me so after the discussion I'm going to merge this. And thanks again!

Note: in v2 this was fixed last year, see this PR. But as I see v2 contained already this explicit node check. This is interesting, because many functions were just copied from v2 into v3, and it seems like the author left the node check part.

@chenuduss

Copy link
Copy Markdown
Contributor Author

Just out of curiosity: have you faced any problem in practice with this error?
Or how did you catch it?

I found this using a static analyzer.

@airween
airween merged commit 3d0440e into owasp-modsecurity:v3/master Oct 28, 2025
89 of 98 checks passed
@airween

airween commented Oct 28, 2025

Copy link
Copy Markdown
Member

Thanks again @chenuduss!

@airween airween added the 3.x Related to ModSecurity version 3.x label Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Related to ModSecurity version 3.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants