Skip to content

Return safely when trimming an empty string - #324

Open
dajiaohuang wants to merge 1 commit into
rhash:masterfrom
dajiaohuang:fix-audit-313-empty-trim
Open

dajiaohuang wants to merge 1 commit into
rhash:masterfrom
dajiaohuang:fix-audit-313-empty-trim

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Fixes #313.

An empty configuration option name reaches str_trim while the parser handles =ignored. Returning before computing the trailing pointer avoids the stack read before the config buffer.

Validation: the AddressSanitizer regression passes on Linux/GCC 13.3, and the base build reports the stack-buffer-overflow at str_trim through read_config.

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.

Avoid underflow when trimming an empty string

1 participant