Scanner stores pointers to exclude/include patterns without ownership #64
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In
src/shared/scanner.clines 27-31,directory_scanner_create()stores pointers to the caller's pattern arrays:These are pointers into the
Config's pattern arrays. If theConfigis freed before the scanner is destroyed, these pointers become dangling. Currently in the codebase, the scanner is always used within the lifetime of the config, but this is an implicit contract that could be violated by future refactoring.Location
src/shared/scanner.c:27-31Suggested Fix
Either:
Config*and reference patterns through itSeverity
Low
Category
Quality