summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-23 19:59:52 +0200
committerToomas Soome <tsoome@me.com>2019-07-07 00:04:23 +0300
commit95c745183e701047fab8e4753d4e8bc1dd1323e7 (patch)
treea35a1aba8fc8e72fa59c5e1dd9a2aec5b38643bc
parent89b213ac9ac098a69d51b5e8693bd6b8d51864a8 (diff)
downloadillumos-gate-95c745183e701047fab8e4753d4e8bc1dd1323e7.tar.gz
11296 cmd-inet: NULL pointer errors
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Garrett D'Amore <garrett@damore.org>
-rw-r--r--usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c4
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c4
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c4
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c6
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c6
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/inetd/config.c6
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c8
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c6
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c4
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c4
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c8
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c16
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c8
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c46
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c4
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c16
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/soconfig.c12
26 files changed, 83 insertions, 97 deletions
diff --git a/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c b/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c
index d73722cc55..caf7987fc7 100644
--- a/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c
+++ b/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c
@@ -435,7 +435,7 @@ ifparse(int argc, char *argv[], struct afswtch *afp)
return (0);
if (strcmp(*argv, "auto-dhcp") == 0 || strcmp(*argv, "dhcp") == 0) {
- if ((parsemode & PARSEFIXED) != NULL) {
+ if ((parsemode & PARSEFIXED) != 0) {
while (argc) {
(void) fputs(*argv++, stdout);
if (--argc != 0)
diff --git a/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c b/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c
index f92dcc6759..f7007286a8 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c
@@ -37,8 +37,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include "ftp_var.h"
#include <arpa/nameser.h>
#include <sys/types.h>
@@ -1524,7 +1522,7 @@ initconn(void)
"parsing failure.\n");
goto bad;
}
- *(c2 - 1) = NULL;
+ *(c2 - 1) = '\0';
/* Delimiter is the next char in the reply string */
delm = *(++c);
while (*c == delm) {
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
index 475e915b2e..223e582072 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
@@ -3517,7 +3517,7 @@ dhcp_walk_interfaces(int af, boolean_t printed_one)
if (ioctl(sock_fd, SIOCGLIFCONF, &lifc) == -1) {
(void) close(sock_fd);
free(lifc.lifc_buf);
- return (NULL);
+ return (B_FALSE);
}
n_ifs = lifc.lifc_len / sizeof (struct lifreq);
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c
index 175310a9a6..1a6364c00f 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c
@@ -235,7 +235,7 @@ nextstr(char *pas)
{
char *next;
- for (next = &pas[strlen(pas) + 1]; *next == NULL; ) {
+ for (next = &pas[strlen(pas) + 1]; *next == '\0'; ) {
next++;
}
diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c
index aa4621d53c..cafcbebb13 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c
@@ -3,8 +3,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c
*/
@@ -126,7 +124,7 @@ ecb_encrypt(struct stinfo *stp, Block in, Block out)
/* this is a kerberos enctype, not a telopt enctype */
dout.enctype = ENCTYPE_UNKNOWN;
- code = krb5_c_encrypt(telnet_context, &stp->str_key, NULL, NULL,
+ code = krb5_c_encrypt(telnet_context, &stp->str_key, 0, NULL,
&din, &dout);
if (code)
(void) fprintf(stderr, gettext(
diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c
index 05d6127211..02bd4a08fa 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c
@@ -3,8 +3,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c
*/
@@ -142,7 +140,7 @@ findencryption(int type)
if (!(I_SUPPORT_ENCRYPT & remote_supports_decrypt & typemask(type)))
return (NULL);
- for (; (ep->type != NULL) && (ep->type != type); ep++);
+ for (; (ep->type != 0) && (ep->type != type); ep++);
return (ep->type ? ep : NULL);
}
diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c
index ea62472061..b4a5c41074 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c
@@ -3,8 +3,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c
*
@@ -255,7 +253,7 @@ kerberos5_send(Authenticator *ap)
}
if ((retval = krb5_cc_get_principal(telnet_context, ccache,
- &creds.client)) != NULL) {
+ &creds.client)) != 0) {
if (auth_debug_mode) {
(void) printf(gettext(
"telnet: Kerberos V5: failure on principal "
@@ -378,7 +376,7 @@ kerberos5_send(Authenticator *ap)
}
if ((auth_sendname((uchar_t *)UserNameRequested,
- strlen(UserNameRequested))) == NULL) {
+ strlen(UserNameRequested))) == 0) {
if (auth_debug_mode)
(void) printf(gettext(
"telnet: Not enough room for user name\r\n"));
diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c
index 9c0cac01c7..9bfbdf832f 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c
@@ -3,8 +3,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
@@ -662,7 +660,7 @@ mklist(buf, name)
*argv = 0;
argvp = argv+1;
n = 0;
- for (cp = cp2 = buf; (c = *cp) != NULL; cp++) {
+ for (cp = cp2 = buf; (c = *cp) != '\0'; cp++) {
if (c == '|' || c == ':') {
*cp++ = '\0';
/*
@@ -1673,7 +1671,7 @@ env_opt_add(ep)
else
*opt_replyp++ = ENV_USERVAR;
for (;;) {
- while ((c = *ep++) != NULL) {
+ while ((c = *ep++) != '\0') {
switch (c&0xff) {
case IAC:
*opt_replyp++ = IAC;
diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c
index 63adcf3dd9..538d1ea09b 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c
+++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c
@@ -1094,7 +1094,7 @@ ilbd_ip_to_str(uint16_t ipversion, struct in6_addr *addr, char *valstr)
IP_COPY_IMPL_2_CLI(addr, &ipaddr);
addrptr = (ipversion == AF_INET) ?
(void *)&ipaddr.ia_v4 : (void *)&ipaddr.ia_v6;
- if (inet_ntop(ipversion, (void *)addrptr, valstr, vallen == NULL))
+ if (inet_ntop(ipversion, (void *)addrptr, valstr, vallen) == NULL)
logerr("ilbd_ip_to_str: inet_ntop failed");
return;
diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c
index 290a7b2cb6..b1e9bc911c 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c
+++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c
@@ -419,7 +419,7 @@ ilbd_get_svr_field(char *valstr, struct in6_addr *sgs_addr,
ip_ver = atoi(ipverstr);
addrptr = (ip_ver == AF_INET) ? (void *)&temp_ip.ia_v4 :
(void *)&temp_ip.ia_v6;
- if (inet_pton(ip_ver, ipaddr, addrptr) == NULL) {
+ if (inet_pton(ip_ver, ipaddr, addrptr) == 0) {
logerr("ilbd_get_svr_field: inet_pton failed");
return;
}
diff --git a/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c b/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c
index 1d84b01853..d183eb5961 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c
+++ b/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c
@@ -48,9 +48,9 @@
/* supported method properties and their attributes */
static inetd_prop_t method_props[] = {
-{PR_EXEC_NAME, "", INET_TYPE_STRING, B_FALSE, IVE_UNSET, NULL, B_FALSE},
-{PR_ARG0_NAME, "", INET_TYPE_STRING, B_TRUE, IVE_UNSET, NULL, B_FALSE},
-{SCF_PROPERTY_TIMEOUT, "", INET_TYPE_COUNT, B_TRUE, IVE_UNSET, NULL, B_FALSE},
+{PR_EXEC_NAME, "", INET_TYPE_STRING, B_FALSE, IVE_UNSET, 0, B_FALSE},
+{PR_ARG0_NAME, "", INET_TYPE_STRING, B_TRUE, IVE_UNSET, 0, B_FALSE},
+{SCF_PROPERTY_TIMEOUT, "", INET_TYPE_COUNT, B_TRUE, IVE_UNSET, 0, B_FALSE},
{NULL},
};
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c b/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c
index 92eb0c81bb..8c6f7d25c2 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -312,9 +310,7 @@ add_default_route(router_addr)
int
-bpanswer(res, nb)
- struct bp_whoami_res *res;
- struct netbuf *nb;
+bpanswer(struct bp_whoami_res *res, struct netbuf *nb)
{
struct in_addr router_addr;
static int set;
@@ -379,7 +375,7 @@ bpanswer(res, nb)
}
if (multiple)
- return (NULL);
+ return (0);
/* our job is done */
exit(0);
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c
index 201023cea9..c69c3c8e89 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c
@@ -54,14 +54,14 @@ ilbadm_val_type_t algo_types[] = {
{(int)ILB_ALG_HASH_IP, "hash-ip", "hip"},
{(int)ILB_ALG_HASH_IP_SPORT, "hash-ip-port", "hipp"},
{(int)ILB_ALG_HASH_IP_VIP, "hash-ip-vip", "hipv"},
- {ILBD_BAD_VAL, NULL, NULL}
+ {ILBD_BAD_VAL, 0, 0}
};
ilbadm_val_type_t topo_types[] = {
{(int)ILB_TOPO_DSR, "DSR", "d"},
{(int)ILB_TOPO_NAT, "NAT", "n"},
{(int)ILB_TOPO_HALF_NAT, "HALF-NAT", "h"},
- {ILBD_BAD_VAL, NULL, NULL}
+ {ILBD_BAD_VAL, 0, 0}
};
void
@@ -916,7 +916,7 @@ i_store_val(char *val, void *store, ilbadm_key_code_t keyword)
rc = ILBADM_INVAL_SYNTAX;
break;
}
- *close = NULL;
+ *close = '\0';
}
rc = i_match_onehost(val, vip, &at);
/* re-assemble string as we found it */
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c b/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c
index 81039c3e86..6907abc8d4 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c
@@ -271,7 +271,7 @@ main(int argc, char *argv[])
/*
* Start delayed processing thread.
*/
- (void) thr_create(NULL, NULL, (void *(*)(void *))do_delay_write, NULL,
+ (void) thr_create(NULL, 0, (void *(*)(void *))do_delay_write, NULL,
THR_NEW_LWP, NULL);
/*
@@ -279,7 +279,7 @@ main(int argc, char *argv[])
*/
for (rdev = rarpdev_head; rdev != NULL; rdev = rdev->next) {
if (rdev->dh_rarp != NULL) {
- (void) thr_create(NULL, NULL,
+ (void) thr_create(NULL, 0,
(void *(*)(void *))do_rarp, (void *)rdev,
THR_NEW_LWP, NULL);
}
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c b/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c
index 181e6cbabe..afeb5a5c55 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c
@@ -922,7 +922,7 @@ auth_is(uchar_t *data, int cnt)
return;
}
- while (aptr->AuthName != NULL &&
+ while (aptr->AuthName != 0 &&
(aptr->AuthName != data[0] || aptr->AuthHow != data[1]))
aptr++;
@@ -1117,7 +1117,7 @@ encrypt_is(uchar_t *data, int cnt)
break;
default:
iv_status = CFB64_IV_BAD;
- encr_data.decrypt.type = NULL;
+ encr_data.decrypt.type = 0;
if (enc_debug)
(void) fprintf(stderr,
"\t(encrypt_is) Can't find type (%d) "
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c
index 66ecf99d37..d8e7c0878f 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c
@@ -810,8 +810,8 @@ modify_inst_props_cb(void *data, scf_walkinfo_t *wip)
switch (mod[j].ip_type) {
case INET_TYPE_INTEGER:
- if (uu_strtoint(value, &new_int, sizeof (new_int), NULL,
- NULL, NULL) == -1)
+ if (uu_strtoint(value, &new_int, sizeof (new_int), 0,
+ 0, 0) == -1)
uu_die(gettext("Error: \"%s\" is not a valid "
"integer value.\n"), value);
@@ -938,8 +938,8 @@ modify_defaults(int argc, char *argv[])
switch (mod[j].ip_type) {
case INET_TYPE_INTEGER:
- if (uu_strtoint(value, &new_int, sizeof (new_int), NULL,
- NULL, NULL) == -1)
+ if (uu_strtoint(value, &new_int, sizeof (new_int), 0,
+ 0, 0) == -1)
uu_die(gettext("Error: \"%s\" is not a valid "
"integer value.\n"), value);
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c
index 914c6f05db..d41ee24918 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c
@@ -3096,7 +3096,7 @@ int ifindex)
/* truncate any logical suffix */
if ((cp = strchr(lr->lifr_name, '@')) != NULL) {
- *cp = NULL;
+ *cp = '\0';
}
/* print interface name */
@@ -4265,8 +4265,8 @@ int *upper)
*upper = (int)strtol(cp, &end2, 10);
SKIPWS(end);
SKIPWS(end2);
- if ((range_st == end) || (*end != NULL) ||
- (cp == end) || (*end2 != NULL)) {
+ if ((range_st == end) || (*end != '\0') ||
+ (cp == end) || (*end2 != '\0')) {
IPQOSCDBG0(L0, "Failed reading a-b\n");
return (IPQOS_CONF_ERR);
}
@@ -4275,7 +4275,7 @@ int *upper)
*lower = *upper = (int)strtol(range_st, &end, 10);
SKIPWS(end);
- if ((range_st == end) || (*end != NULL)) {
+ if ((range_st == end) || (*end != '\0')) {
IPQOSCDBG0(L0, "Failed reading a\n");
return (IPQOS_CONF_ERR);
}
@@ -4405,7 +4405,7 @@ str_val_nd_t *enum_nvs)
} else {
value = (int)strtol(svalue, &end, 10);
SKIPWS(end);
- if ((svalue == end) || (*end != NULL)) {
+ if ((svalue == end) || (*end != '\0')) {
IPQOSCDBG0(L0, "Invalid value\n");
goto array_err;
}
@@ -4971,7 +4971,7 @@ read_enum_nvs(char *line, char *module_name)
goto fail;
}
bcopy(start, name, len);
- name[len] = NULL;
+ name[len] = '\0';
IPQOSCDBG1(L0, "Stored name: %s\n", name);
/* read assignment */
@@ -5190,7 +5190,7 @@ char *module)
token = strtok(info_str, ",");
*size = (uint32_t)strtol(token, &end, 10);
SKIPWS(end);
- if ((end == token) || (*end != NULL)) {
+ if ((end == token) || (*end != '\0')) {
IPQOSCDBG0(L0, "Invalid size\n");
goto fail;
}
@@ -9326,7 +9326,7 @@ char *dstpath)
/* not pwd or root */
} else {
- *pathend = NULL;
+ *pathend = '\0';
tmppath = malloc(strlen(dstpath) + strlen("/ipqosconf.tmp") +
1);
if (tmppath == NULL) {
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c
index 60f3ed937c..e6257c6184 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c
@@ -735,7 +735,7 @@ static keywdtab_t idtypes[] = {
{SADB_X_IDENTTYPE_ADDR_RANGE, "rangev4"},
{SADB_X_IDENTTYPE_ADDR_RANGE, "rangev6"},
{SADB_X_IDENTTYPE_KEY_ID, "keyid"},
- {NULL, 0}
+ {0, NULL}
};
static int
@@ -903,7 +903,7 @@ static keywdtab_t psfldtypes[] = {
{PSFLD_REMIDTYPE, "remoteidtype"},
{PSFLD_MODE, "ike_mode"},
{PSFLD_KEY, "key"},
- {NULL, 0}
+ {0, NULL}
};
static int
@@ -929,7 +929,7 @@ static keywdtab_t ikemodes[] = {
{IKE_XCHG_IDENTITY_PROTECT, "main"},
{IKE_XCHG_AGGRESSIVE, "aggressive"},
{IKE_XCHG_IP_AND_AGGR, "both"},
- {NULL, 0}
+ {0, NULL}
};
static int
@@ -3348,7 +3348,7 @@ parseit(int argc, char **argv, char *notused, boolean_t notused_either)
case IKE_SVC_DUMP_AUTHALGS:
case IKE_SVC_DUMP_PS:
case IKE_SVC_DUMP_CERTCACHE:
- if (argc != NULL) {
+ if (argc != 0) {
print_dump_help();
break;
}
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c
index fbd72b9a40..e8203530b4 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c
@@ -3026,7 +3026,7 @@ parse_address(int type, char *addr_str)
ptr = strchr(addr_str, '/');
if (ptr != NULL) {
has_mask = B_TRUE;
- *ptr++ = NULL;
+ *ptr++ = '\0';
prefix_len = in_getprefixlen(ptr);
if (prefix_len < 0) {
@@ -3740,14 +3740,14 @@ scan:
/* Truncate at the beginning of a comment */
cp = strchr(buf, '#');
if (cp != NULL)
- *cp = NULL;
+ *cp = '\0';
/* Skip any whitespace */
- while (*buf != NULL && isspace(*buf))
+ while (*buf != '\0' && isspace(*buf))
buf++;
/* Empty line */
- if (*buf == NULL)
+ if (*buf == '\0')
continue;
/*
@@ -3772,15 +3772,15 @@ scan:
tmp_buf = buf;
/* Skip until next whitespace or CURL_BEGIN */
- while (*buf != NULL && !isspace(*buf) &&
+ while (*buf != '\0' && !isspace(*buf) &&
*buf != CURL_BEGIN)
buf++;
- if (*buf != NULL) {
+ if (*buf != '\0') {
if (tmp_buf == buf) /* No action token */
goto error;
if (*buf == CURL_BEGIN) {
- *buf = NULL;
+ *buf = '\0';
/* Allocate an extra byte for the null also */
if ((*action = malloc(strlen(tmp_buf) + 1)) ==
NULL) {
@@ -3791,7 +3791,7 @@ scan:
*buf = CURL_BEGIN;
} else {
/* We have hit a space */
- *buf++ = NULL;
+ *buf++ = '\0';
/* Allocate an extra byte for the null also */
if ((*action = malloc(strlen(tmp_buf) + 1)) ==
NULL) {
@@ -3804,7 +3804,7 @@ scan:
* Copy the rest of the line into the
* leftover buffer.
*/
- if (*buf != NULL) {
+ if (*buf != '\0') {
(void) strlcpy(lo_buf, buf, sizeof (lo_buf));
*leftover = lo_buf;
} else {
@@ -3873,14 +3873,14 @@ scan:
/* Truncate at the beginning of a comment */
cp = strchr(buf, '#');
if (cp != NULL)
- *cp = NULL;
+ *cp = '\0';
/* Skip any whitespace */
- while (*buf != NULL && isspace(*buf))
+ while (*buf != '\0' && isspace(*buf))
buf++;
/* Empty line */
- if (*buf == NULL)
+ if (*buf == '\0')
continue;
/*
* Store the command for error reporting
@@ -3920,15 +3920,15 @@ scan:
* Arguments are separated by white spaces or
* newlines. Scan till you see a CURL_END.
*/
- while (*buf != NULL) {
+ while (*buf != '\0') {
if (*buf == CURL_END) {
ret:
- *buf++ = NULL;
+ *buf++ = '\0';
/*
* Copy the rest of the line into the
* leftover buffer if any.
*/
- if (*buf != NULL) {
+ if (*buf != '\0') {
(void) strlcpy(lo_buf, buf,
sizeof (lo_buf));
*leftover = lo_buf;
@@ -3941,14 +3941,14 @@ ret:
* Skip any trailing whitespace until we see a
* non white-space character.
*/
- while (*buf != NULL && isspace(*buf))
+ while (*buf != '\0' && isspace(*buf))
buf++;
if (*buf == CURL_END)
goto ret;
/* Scan the next line as this buffer is empty */
- if (*buf == NULL)
+ if (*buf == '\0')
break;
if (i >= MAXARGS) {
@@ -3965,7 +3965,7 @@ ret:
* Real scan of the argument takes place here.
* Skip past till space or CURL_END.
*/
- while (*buf != NULL && !isspace(*buf) &&
+ while (*buf != '\0' && !isspace(*buf) &&
*buf != CURL_END) {
buf++;
}
@@ -3973,9 +3973,9 @@ ret:
* Either a space or we have hit the CURL_END or
* the real end.
*/
- if (*buf != NULL) {
+ if (*buf != '\0') {
if (*buf == CURL_END) {
- *buf++ = NULL;
+ *buf++ = '\0';
if ((argvec[i] = malloc(strlen(tmp_buf)
+ 1)) == NULL) {
warn("malloc");
@@ -3993,7 +3993,7 @@ ret:
* Copy the rest of the line into the
* leftover buffer.
*/
- if (*buf != NULL) {
+ if (*buf != '\0') {
(void) strlcpy(lo_buf, buf,
sizeof (lo_buf));
*leftover = lo_buf;
@@ -4002,7 +4002,7 @@ ret:
}
return (PARSE_SUCCESS);
} else {
- *buf++ = NULL;
+ *buf++ = '\0';
}
}
/*
@@ -4151,7 +4151,7 @@ parse_one(FILE *fp, act_prop_t *act_props)
if (leftover != NULL) {
/* Accomodate spaces at the end */
- while (*leftover != NULL) {
+ while (*leftover != '\0') {
if (*leftover == BACK_SLASH) {
warnx(gettext("Invalid line "
"continuation character."));
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c
index 14cb3eb28d..9667fa4047 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c
@@ -541,8 +541,8 @@ static struct toktable {
{"nat_rport", TOK_NATRPORT, NEXTNUM},
{"encap", TOK_ENCAP, NEXTNUMSTR},
- {"outbound", TOK_FLAG_OUTBOUND, NULL},
- {"inbound", TOK_FLAG_INBOUND, NULL},
+ {"outbound", TOK_FLAG_OUTBOUND, 0},
+ {"inbound", TOK_FLAG_INBOUND, 0},
{"reserved_bits", TOK_RESERVED, NEXTNUM},
{"replay_value", TOK_REPLAY_VALUE, NEXTNUM},
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c
index aed788596e..7f3233154f 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c
@@ -108,14 +108,14 @@ kmf_to_kssl(int nxkey, KMF_RAW_KEY_DATA *rsa, int ncerts,
{CKA_ID, NULL, 0}
};
kssl_object_attribute_t kssl_tmpl_attrs[MAX_ATTR_CNT] = {
- {SUN_CKA_MODULUS, NULL, 0},
- {SUN_CKA_PUBLIC_EXPONENT, NULL, 0},
- {SUN_CKA_PRIVATE_EXPONENT, NULL, 0},
- {SUN_CKA_PRIME_1, NULL, 0},
- {SUN_CKA_PRIME_2, NULL, 0},
- {SUN_CKA_EXPONENT_1, NULL, 0},
- {SUN_CKA_EXPONENT_2, NULL, 0},
- {SUN_CKA_COEFFICIENT, NULL, 0}
+ {SUN_CKA_MODULUS, 0, 0},
+ {SUN_CKA_PUBLIC_EXPONENT, 0, 0},
+ {SUN_CKA_PRIVATE_EXPONENT, 0, 0},
+ {SUN_CKA_PRIME_1, 0, 0},
+ {SUN_CKA_PRIME_2, 0, 0},
+ {SUN_CKA_EXPONENT_1, 0, 0},
+ {SUN_CKA_EXPONENT_2, 0, 0},
+ {SUN_CKA_COEFFICIENT, 0, 0}
};
KMF_BIGINT priv_key_bignums[MAX_ATTR_CNT];
int attr_cnt;
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c
index 690377cc2d..263f3f62b2 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c
@@ -603,7 +603,7 @@ CPL_MATCH_FN(cmd_cpl_fn)
return (add_stuff(cpl, line, ncp_scope_cmds, word_end));
}
/* should never get here */
- return (NULL);
+ return (0);
}
const char *
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c
index 88e2ff0d9f..801611ff9b 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c
@@ -1991,7 +1991,7 @@ xdr_entry4(register XDR *xdrs, entry4 *objp)
objp->nextentry = (entry4 *)mem_alloc(sizeof (entry4));
if (objp->nextentry == NULL)
- return (NULL);
+ return (FALSE);
bzero(objp->nextentry, sizeof (entry4));
objp = objp->nextentry;
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c
index 5c6bde0cd6..332069508c 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c
@@ -98,7 +98,7 @@ interface_t INTERFACES[] = {
{ DL_6TO4, 0, 9, 1, IPPROTO_ENCAP, IPPROTO_IPV6,
ipv4_header_len, interpret_iptun, B_FALSE },
- { (uint_t)-1, 0, 0, 0, 0, NULL, NULL, B_FALSE }
+ { (uint_t)-1, 0, 0, 0, 0, 0, NULL, B_FALSE }
};
/* externals */
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c
index 3f745b30eb..7be45437d5 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c
@@ -164,7 +164,7 @@ reservedport(int proto, int port)
switch (proto) {
case IPPROTO_TCP: pt = pt_tcp; break;
case IPPROTO_UDP: pt = pt_udp; break;
- default: return (NULL);
+ default: return (0);
}
for (p = pt; p->pt_num; p++) {
if (port == p->pt_num)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c b/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c
index a9315cb218..6f990db460 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c
+++ b/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c
@@ -268,27 +268,27 @@ split_line(char *line, char *argvec[], int maxargvec)
/* Truncate at the beginning of a comment */
cp = strchr(line, '#');
if (cp != NULL)
- *cp = NULL;
+ *cp = '\0';
/* CONSTCOND */
while (1) {
/* Skip any whitespace */
- while (isspace(*line) && *line != NULL)
+ while (isspace(*line))
line++;
if (i >= maxargvec)
return (i);
argvec[i] = line;
- if (*line == NULL)
+ if (*line == '\0')
return (i);
i++;
/* Skip until next whitespace */
- while (!isspace(*line) && *line != NULL)
+ while (!isspace(*line) && *line != '\0')
line++;
- if (*line != NULL) {
+ if (*line != '\0') {
/* Break off argument */
- *line++ = NULL;
+ *line++ = '\0';
}
}
/* NOTREACHED */