Skip to content

Commit 4902195

Browse files
committed
BUILD: acl: silence a possible null deref warning in parse_acl_expr()
The fix in commit 441cd61 ("BUG/MINOR: acl: set arg_list->kw to aclkw->kw string literal if aclkw is found") involves an unchecked access to "al" after that one is tested for possibly being NULL. This rightfully upsets Coverity (GH #3095) and might also trigger warnings depending on the compilers. However, no known caller to date passes a NULL arg list here so there's no way to trigger this theoretical bug. This should be backported along with the fix above to avoid emitting warnings, possibly as far as 2.6 since that fix was tagged as such.
1 parent c128887 commit 4902195

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/acl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
171171
if (aclkw) {
172172
/* OK we have a real ACL keyword */
173173

174-
al->kw = aclkw->kw;
174+
if (al)
175+
al->kw = aclkw->kw;
176+
175177
/* build new sample expression for this ACL */
176178
smp = calloc(1, sizeof(*smp));
177179
if (!smp) {

0 commit comments

Comments
 (0)