-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(acl): prevent NULL pointer dereference on malformed selector in ACL file #4214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2580,6 +2580,8 @@ static sds ACLLoadFromFile(const char *filename) { | |
| if (!acl_args) { | ||
| errors = sdscatprintf(errors, "%s:%d: Unmatched parenthesis in selector definition.", server.acl_filename, | ||
| linenum); | ||
| sdsfreesplitres(argv, argc); | ||
| continue; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This deserves a regression test, since the crash is trivially reachable from an aclfile: |
||
| } | ||
|
|
||
| int syntax_error = 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every other error message in this function ends with a trailing
". "separator (src/acl.c:2537, 2559, 2569, 2600); this one doesn't. Now that this path no longer crashes, the message actually surfaces, and the missing space makes the concatenated output run together with the next line's error or with the final suffix appended at src/acl.c:2679:...selector definition.WARNING: ACL errors detected....