Skip to content

Fix DEREF_OF_NULL.RET.STAT in ausearch-match.c#510

Merged
stevegrubb merged 1 commit intolinux-audit:masterfrom
mikhailnov:svace2
Feb 28, 2026
Merged

Fix DEREF_OF_NULL.RET.STAT in ausearch-match.c#510
stevegrubb merged 1 commit intolinux-audit:masterfrom
mikhailnov:svace2

Conversation

@mikhailnov
Copy link
Contributor

Replace do-while loops with while loops to properly check for NULL before dereferencing pointers returned by ilist_get_cur() and slist_get_cur().

Svace report (for audit v3.0.8):

  1. Return value of 'ilist_get_cur' is dereferenced at
    ausearch-match.c:138 without checking for NULL (CWE476)
  2. Return value of 'slist_get_cur' is dereferenced at
    ausearch-match.c:223 without checking for NULL (CWE476)

Replace do-while loops with while loops to properly check for NULL
before dereferencing pointers returned by ilist_get_cur() and
slist_get_cur().

Svace report:
  1) Return value of 'ilist_get_cur' is dereferenced at
     ausearch-match.c:138 without checking for NULL (CWE476)
  2) Return value of 'slist_get_cur' is dereferenced at
     ausearch-match.c:223 without checking for NULL (CWE476)

Co-authored-by: Z.AI GLM-5
@stevegrubb stevegrubb merged commit d00aa1a into linux-audit:master Feb 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants