summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-22 13:53:14 +0200
committerToomas Soome <tsoome@me.com>2019-07-03 10:38:19 +0300
commit5b8cbb8e38f948539d47f11d870efecefc5df9c0 (patch)
tree8da46e6ad8510552e43c9a5a6250b720547317ff
parentbaf3abb99faf2cc8376a1f8ab38dfa1730c2ca13 (diff)
downloadillumos-joyent-5b8cbb8e38f948539d47f11d870efecefc5df9c0.tar.gz
11156 libzfs: NULL pointer errors
Reviewed by: John Levon <john.levon@joyent.com> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c12
-rw-r--r--usr/src/lib/libzfs/common/libzfs_sendrecv.c2
-rw-r--r--usr/src/lib/libzfs/common/libzfs_util.c6
3 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index 628125e38b..a0f401de45 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -2699,7 +2699,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
/* 'legacy' or 'none' */
(void) strlcpy(propbuf, str, proplen);
}
- zcp_check(zhp, prop, NULL, propbuf);
+ zcp_check(zhp, prop, 0, propbuf);
break;
case ZFS_PROP_ORIGIN:
@@ -2707,7 +2707,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
if (str == NULL)
return (-1);
(void) strlcpy(propbuf, str, proplen);
- zcp_check(zhp, prop, NULL, str);
+ zcp_check(zhp, prop, 0, str);
break;
case ZFS_PROP_CLONES:
@@ -2797,7 +2797,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
abort();
}
(void) snprintf(propbuf, proplen, "%s", str);
- zcp_check(zhp, prop, NULL, propbuf);
+ zcp_check(zhp, prop, 0, propbuf);
break;
case ZFS_PROP_MOUNTED:
@@ -2823,7 +2823,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
* consumers.
*/
(void) strlcpy(propbuf, zhp->zfs_name, proplen);
- zcp_check(zhp, prop, NULL, propbuf);
+ zcp_check(zhp, prop, 0, propbuf);
break;
case ZFS_PROP_MLSLABEL:
@@ -2900,7 +2900,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
return (-1);
(void) strlcpy(propbuf, str, proplen);
- zcp_check(zhp, prop, NULL, str);
+ zcp_check(zhp, prop, 0, str);
break;
case PROP_TYPE_INDEX:
@@ -2911,7 +2911,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
return (-1);
(void) strlcpy(propbuf, strval, proplen);
- zcp_check(zhp, prop, NULL, strval);
+ zcp_check(zhp, prop, 0, strval);
break;
default:
diff --git a/usr/src/lib/libzfs/common/libzfs_sendrecv.c b/usr/src/lib/libzfs/common/libzfs_sendrecv.c
index a25574cc19..27f05f101e 100644
--- a/usr/src/lib/libzfs/common/libzfs_sendrecv.c
+++ b/usr/src/lib/libzfs/common/libzfs_sendrecv.c
@@ -3548,7 +3548,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
DMU_BACKUP_FEATURE_RAW;
boolean_t embedded = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
DMU_BACKUP_FEATURE_EMBED_DATA;
- stream_wantsnewfs = (drrb->drr_fromguid == NULL ||
+ stream_wantsnewfs = (drrb->drr_fromguid == 0 ||
(drrb->drr_flags & DRR_FLAG_CLONE) || originsnap) && !resuming;
if (stream_wantsnewfs) {
diff --git a/usr/src/lib/libzfs/common/libzfs_util.c b/usr/src/lib/libzfs/common/libzfs_util.c
index b56c394b59..d9ba15e9e6 100644
--- a/usr/src/lib/libzfs/common/libzfs_util.c
+++ b/usr/src/lib/libzfs/common/libzfs_util.c
@@ -802,9 +802,9 @@ zcmd_free_nvlists(zfs_cmd_t *zc)
free((void *)(uintptr_t)zc->zc_nvlist_conf);
free((void *)(uintptr_t)zc->zc_nvlist_src);
free((void *)(uintptr_t)zc->zc_nvlist_dst);
- zc->zc_nvlist_conf = NULL;
- zc->zc_nvlist_src = NULL;
- zc->zc_nvlist_dst = NULL;
+ zc->zc_nvlist_conf = 0;
+ zc->zc_nvlist_src = 0;
+ zc->zc_nvlist_dst = 0;
}
static int