Project

General

Profile

Actions

Bug #6317

closed

NULL pointer constant is not an int nor unsigned int in libzfs

Added by Richard PALO almost 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2015-10-10
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

After a recent libzfs commit, here are the current mods to fix the NULL pointer constant issue:

diff --git a/usr/src/lib/libzfs/common/libzfs_sendrecv.c b/usr/src/lib/libzfs/common/libzfs_sendrecv.c
index b9b0f68..6622403 100644
--- a/usr/src/lib/libzfs/common/libzfs_sendrecv.c
+++ b/usr/src/lib/libzfs/common/libzfs_sendrecv.c
@@ -3053,7 +3053,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,

     boolean_t resuming = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo) &
         DMU_BACKUP_FEATURE_RESUMING;
-    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 507a72c..f08e15f 100644
--- a/usr/src/lib/libzfs/common/libzfs_util.c
+++ b/usr/src/lib/libzfs/common/libzfs_util.c
@@ -773,9 +773,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 = (uintptr_t)NULL;
+    zc->zc_nvlist_src = (uintptr_t)NULL;
+    zc->zc_nvlist_dst = (uintptr_t)NULL;
 }

 static int


Related issues

Related to illumos gate - Bug #11156: libzfs: NULL pointer errorsClosedToomas Soome

Actions
Related to illumos gate - Feature #12661: null.h: enable NULL pointer for SPARCClosedToomas Soome

Actions
Actions

Also available in: Atom PDF