mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-01-12 19:20:28 +03:00
Fix null pointer dereferences in PAM
Coverity caught these. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #13889
This commit is contained in:
parent
6c8e9f09c2
commit
4df8ccc83d
@ -531,7 +531,6 @@ zfs_key_config_get_dataset(zfs_key_config_t *config)
|
|||||||
if (zhp == NULL) {
|
if (zhp == NULL) {
|
||||||
pam_syslog(NULL, LOG_ERR, "dataset %s not found",
|
pam_syslog(NULL, LOG_ERR, "dataset %s not found",
|
||||||
config->homes_prefix);
|
config->homes_prefix);
|
||||||
zfs_close(zhp);
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -543,6 +542,10 @@ zfs_key_config_get_dataset(zfs_key_config_t *config)
|
|||||||
return (dsname);
|
return (dsname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config->homes_prefix == NULL) {
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
size_t len = ZFS_MAX_DATASET_NAME_LEN;
|
size_t len = ZFS_MAX_DATASET_NAME_LEN;
|
||||||
size_t total_len = strlen(config->homes_prefix) + 1
|
size_t total_len = strlen(config->homes_prefix) + 1
|
||||||
+ strlen(config->username);
|
+ strlen(config->username);
|
||||||
|
Loading…
Reference in New Issue
Block a user