diff options
author | Christophe Varoqui <christophe.varoqui@opensvc.com> | 2010-01-22 12:26:39 +0100 |
---|---|---|
committer | Christophe Varoqui <christophe.varoqui@opensvc.com> | 2010-01-22 12:26:39 +0100 |
commit | 82c55f46c9f23a601a8a33f96907ff7a144d0db1 (patch) | |
tree | 727ad0cc68ff3b6c795d6af92bde886fe86c28e5 | |
parent | c060b13314aadf3f60b887c726bb524d0d0ae0a7 (diff) | |
download | multipath-tools-82c55f46c9f23a601a8a33f96907ff7a144d0db1.tar.gz multipath-tools-82c55f46c9f23a601a8a33f96907ff7a144d0db1.tar.bz2 multipath-tools-82c55f46c9f23a601a8a33f96907ff7a144d0db1.zip |
Add checks before use conf->xxx now that they can be null
-rw-r--r-- | libmultipath/dict.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libmultipath/dict.c b/libmultipath/dict.c index ee4de68..45423c6 100644 --- a/libmultipath/dict.c +++ b/libmultipath/dict.c @@ -1427,7 +1427,7 @@ snprint_hw_getuid_callout (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->getuid) + if (!hwe->getuid || !conf->getuid) return 0; if (strlen(hwe->getuid) == strlen(conf->getuid) && !strcmp(hwe->getuid, conf->getuid)) @@ -1441,7 +1441,7 @@ snprint_hw_prio (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->prio_name) + if (!hwe->prio_name || !conf->prio_name) return 0; if (!strcmp(hwe->prio_name, conf->prio_name)) return 0; @@ -1454,7 +1454,7 @@ snprint_hw_features (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->features) + if (!hwe->features || !conf->features) return 0; if (strlen(hwe->features) == strlen(conf->features) && !strcmp(hwe->features, conf->features)) @@ -1468,7 +1468,7 @@ snprint_hw_hardware_handler (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->hwhandler) + if (!hwe->hwhandler || !conf->hwhandler) return 0; if (strlen(hwe->hwhandler) == strlen(conf->hwhandler) && !strcmp(hwe->hwhandler, conf->hwhandler)) @@ -1482,7 +1482,7 @@ snprint_hw_selector (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->selector) + if (!hwe->selector || !conf->selector) return 0; if (strlen(hwe->selector) == strlen(conf->selector) && !strcmp(hwe->selector, conf->selector)) @@ -1498,7 +1498,7 @@ snprint_hw_path_grouping_policy (char * buff, int len, void * data) char str[POLICY_NAME_SIZE]; - if (!hwe->pgpolicy) + if (!hwe->pgpolicy || !conf->pgpolicy) return 0; if (hwe->pgpolicy == conf->pgpolicy) return 0; @@ -1513,7 +1513,7 @@ snprint_hw_failback (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->pgfailback) + if (!hwe->pgfailback || !conf->pgfailback) return 0; if (hwe->pgfailback == conf->pgfailback) return 0; @@ -1536,7 +1536,7 @@ snprint_hw_rr_weight (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->rr_weight) + if (!hwe->rr_weight || !conf->rr_weight) return 0; if (hwe->rr_weight == conf->rr_weight) return 0; @@ -1623,7 +1623,7 @@ snprint_hw_path_checker (char * buff, int len, void * data) { struct hwentry * hwe = (struct hwentry *)data; - if (!hwe->checker_name) + if (!hwe->checker_name || !conf->checker_name) return 0; if (!strcmp(hwe->checker_name, conf->checker_name)) return 0; |