HomeFreeBSD

MAC/do: parse_rule_element(): Fix a panic, harden, simplify

Description

MAC/do: parse_rule_element(): Fix a panic, harden, simplify

The panic is caused by dereferencing 'element' at a point where it can
be NULL (if string ends at the ':').

Harden and simplify by enforcing the control flow rule in this function
that jumping to the end is reserved for error cases.

Reviewed by: bapt
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47605

Details

Provenance
olceAuthored on Jul 3 2024, 2:13 PM
Reviewer
bapt
Differential Revision
D47605: MAC/do: parse_rule_element(): Fix a panic, harden, simplify
Parents
rG73cecc0ef78e: MAC/do: Move destroy() to a better place
Branches
Unknown
Tags
Unknown