diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-04-26 11:30:36 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-02 08:10:17 -0400 |
commit | 6d7781a0cfef141a647436cc0cc3e339fd3f413d (patch) | |
tree | 2d84a6e2af10c5a7551f2066ea75aa7f6b3b19e2 | |
parent | 236f2207266afed01367d1f6d1cfd7d8c3dff34c (diff) | |
download | sssd-6d7781a0cfef141a647436cc0cc3e339fd3f413d.tar.gz sssd-6d7781a0cfef141a647436cc0cc3e339fd3f413d.tar.bz2 sssd-6d7781a0cfef141a647436cc0cc3e339fd3f413d.zip |
HBAC: Prevent NULL dereference in hbac_evaluate
'info' is optional parameter and can be set to NULL
-rw-r--r-- | src/providers/ipa/hbac_evaluator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/providers/ipa/hbac_evaluator.c b/src/providers/ipa/hbac_evaluator.c index a41aa5bb..6190fe27 100644 --- a/src/providers/ipa/hbac_evaluator.c +++ b/src/providers/ipa/hbac_evaluator.c @@ -147,8 +147,10 @@ enum hbac_eval_result hbac_evaluate(struct hbac_rule **rules, } else { /* An error occurred processing this rule */ result = HBAC_EVAL_ERROR; - (*info)->code = ret; - (*info)->rule_name = strdup(rules[i]->name); + if (info) { + (*info)->code = ret; + (*info)->rule_name = strdup(rules[i]->name); + } /* Explicitly not checking the result of strdup(), since if * it's NULL, we can't do anything anyway. */ |