Project

General

Profile

Actions

Bug #8641

closed
DB DB

malloc-error-check.cocci: broken regex alternation makes script a no-op

Bug #8641: malloc-error-check.cocci: broken regex alternation makes script a no-op

Added by Denis Balashov 25 days ago. Updated 18 days ago.

Status:
Closed
Priority:
Normal
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

The identifier regex in qa/coccinelle/malloc-error-check.cocci uses
PCRE-style '(A|B)' syntax in all five identifier =~ patterns. However,
Coccinelle uses OCaml Str as its regex engine, where '|' and '()' are
literal characters, not alternation operators.

As a result, the @malloced rule never matched any SC*alloc function call,
making the entire script silently produce no output — all unchecked
allocations in the codebase went unreported.

Fix: replace '(SCMalloc|SCStrdup|...)' with 'SCMalloc\|SCStrdup\|...'
(OCaml Str alternation syntax) in all five patterns.

This bug was present from the beginning — it is not related to a
Coccinelle version update.

PR
https://github.com/OISF/suricata/pull/15584

DB Updated by Denis Balashov 25 days ago Actions #1

  • Description updated (diff)

SS Updated by Samaresh Kumar singh 24 days ago Actions #2

  • Assignee set to Samaresh Kumar singh

SS Updated by Samaresh Kumar singh 24 days ago Actions #3

  • Assignee changed from Samaresh Kumar singh to Denis Balashov

JI Updated by Jason Ish 18 days ago Actions #4

  • Status changed from New to Closed
Actions

Also available in: PDF Atom