mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Fix coverity defects: CID 147488, 147490
CID 147488, Type:explicit null dereferenced CID 147490, Type:dereference null return value Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn> Closes #5237
This commit is contained in:
@@ -1585,6 +1585,7 @@ zprop_parse_value(libzfs_handle_t *hdl, nvpair_t *elem, int prop,
|
||||
const char *propname;
|
||||
char *value;
|
||||
boolean_t isnone = B_FALSE;
|
||||
int err = 0;
|
||||
|
||||
if (type == ZFS_TYPE_POOL) {
|
||||
proptype = zpool_prop_get_type(prop);
|
||||
@@ -1607,7 +1608,12 @@ zprop_parse_value(libzfs_handle_t *hdl, nvpair_t *elem, int prop,
|
||||
"'%s' must be a string"), nvpair_name(elem));
|
||||
goto error;
|
||||
}
|
||||
(void) nvpair_value_string(elem, svalp);
|
||||
err = nvpair_value_string(elem, svalp);
|
||||
if (err != 0) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"'%s' is invalid"), nvpair_name(elem));
|
||||
goto error;
|
||||
}
|
||||
if (strlen(*svalp) >= ZFS_MAXPROPLEN) {
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"'%s' is too long"), nvpair_name(elem));
|
||||
|
||||
Reference in New Issue
Block a user