summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-26 11:30:36 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-05-02 08:10:17 -0400
commit6d7781a0cfef141a647436cc0cc3e339fd3f413d (patch)
tree2d84a6e2af10c5a7551f2066ea75aa7f6b3b19e2 /src
parent236f2207266afed01367d1f6d1cfd7d8c3dff34c (diff)
downloadsssd-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
Diffstat (limited to 'src')
-rw-r--r--src/providers/ipa/hbac_evaluator.c6
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.
*/