diff options
| author | Toomas Soome <tsoome@me.com> | 2019-01-23 09:58:41 +0200 |
|---|---|---|
| committer | Toomas Soome <tsoome@me.com> | 2019-07-05 23:57:25 +0300 |
| commit | 98e973578ca69ba3ce659c761190cbf3558d359c (patch) | |
| tree | 328ec4ca60de1057497ea9f936c8d33eb8de17e5 /usr/src/cmd/allocate | |
| parent | 82be58ff71c54701f4bfbbb526b4ea3d8f899c22 (diff) | |
| download | illumos-joyent-98e973578ca69ba3ce659c761190cbf3558d359c.tar.gz | |
11292 allocate: NULL pointer errors
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/cmd/allocate')
| -rw-r--r-- | usr/src/cmd/allocate/allocate3.c | 11 | ||||
| -rw-r--r-- | usr/src/cmd/allocate/mkdevalloc.c | 10 |
2 files changed, 10 insertions, 11 deletions
diff --git a/usr/src/cmd/allocate/allocate3.c b/usr/src/cmd/allocate/allocate3.c index 9da5745e0c..7c81ad0f46 100644 --- a/usr/src/cmd/allocate/allocate3.c +++ b/usr/src/cmd/allocate/allocate3.c @@ -812,13 +812,12 @@ mk_revoke(int optflag, char *file) continue; } (void) close(fp); - if (strcmp(info.pr_fname, "vold") == NULL) { + if (strcmp(info.pr_fname, "vold") == 0) { dprintf("%d matched vold name\n", fuserpid); continue; } - if (strcmp(info.pr_fname, "deallocate") - == NULL) { + if (strcmp(info.pr_fname, "deallocate") == 0) { dprintf("%d matched deallocate name\n", fuserpid); continue; @@ -1147,7 +1146,7 @@ out: int _allocate_dev(int optflag, uid_t uid, devalloc_t *da, char *zonename, - int *lock_fd) + int *lock_fd) { int i; int bytes = 0; @@ -1156,8 +1155,8 @@ _allocate_dev(int optflag, uid_t uid, devalloc_t *da, char *zonename, int dealloc_optflag = 0; char *fname = NULL; char file_name[MAXPATHLEN]; - devmap_t *dm; - struct stat stat_buf; + devmap_t *dm; + struct stat stat_buf; struct state_file sf; struct zone_path zpath; diff --git a/usr/src/cmd/allocate/mkdevalloc.c b/usr/src/cmd/allocate/mkdevalloc.c index 508f5961c4..d9dfaccbc9 100644 --- a/usr/src/cmd/allocate/mkdevalloc.c +++ b/usr/src/cmd/allocate/mkdevalloc.c @@ -319,7 +319,7 @@ dotape() while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* if array full, then expand it */ @@ -520,7 +520,7 @@ doaudio() while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* if array full, then expand it */ @@ -903,7 +903,7 @@ docd() while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* get device # (disk #) */ @@ -954,7 +954,7 @@ found: while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* get device # (disk #) */ @@ -1111,7 +1111,7 @@ dormdisk(int cd_count) checked = 0; removable = 0; /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* get device # (disk #) */ |
