summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2021-06-22 10:56:41 -0400
committerDan McDonald <danmcd@joyent.com>2021-06-22 10:56:41 -0400
commitd2efcfc81ce15b9a53a68d28a4eb440687ac3f22 (patch)
tree7068d2243d27bed2e4212e455e63cf56c57b52ac
parenta9b847ec2e204c21561a215d258d6a5ca277a2cf (diff)
parent0b9a51588b7231474f7b4009cb9cad83e4db7b74 (diff)
downloadillumos-joyent-d2efcfc81ce15b9a53a68d28a4eb440687ac3f22.tar.gz
[illumos-gate merge]
commit 0b9a51588b7231474f7b4009cb9cad83e4db7b74 13809 cpio: variable may be used uninitialized commit cdfd7f6baf7b308aedaeb7a7f4a89a4dccd9313e 13867 netstat shows duplicated data for UDP source and dest addresses commit b5358705b92a175b02aad08cd1c6b83dc69e2ae6 13811 libmtmalloc: 'size_nx' may be used uninitialized commit 0d1087e85d1cd423a6cbe5358a51a160350e956e 13865 don't pass NV_ENCODE_NATIVE to nvlist_unpack() commit f1866c4b3066e4e43e7ba9c4cef7fcfaadaddd1f 13793 va_arg(9F): va_arg() returns type, not (type *)
-rw-r--r--usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_door.c6
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c7
-rw-r--r--usr/src/cmd/cpio/Makefile3
-rw-r--r--usr/src/cmd/cpio/cpio.c20
-rw-r--r--usr/src/lib/fm/topo/modules/common/pcibus/pcibus.c3
-rw-r--r--usr/src/lib/libdladm/common/libdlmgmt.c2
-rw-r--r--usr/src/lib/libipadm/common/ipadm_addr.c6
-rw-r--r--usr/src/lib/libipadm/common/libipadm.c2
-rw-r--r--usr/src/lib/libmtmalloc/Makefile.com2
-rw-r--r--usr/src/lib/libmtmalloc/common/mtmalloc.c6
-rw-r--r--usr/src/man/man9f/va_arg.9f4
-rw-r--r--usr/src/uts/common/io/ufmtest.c2
12 files changed, 30 insertions, 33 deletions
diff --git a/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_door.c b/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_door.c
index bb4ffcbf0e..1f1308c364 100644
--- a/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_door.c
+++ b/usr/src/cmd/cmd-inet/lib/ipmgmtd/ipmgmt_door.c
@@ -341,7 +341,7 @@ ipmgmt_setaddr_handler(void *argp)
int err = 0;
nvlbuf = (char *)argp + sizeof (ipmgmt_setaddr_arg_t);
- if ((err = nvlist_unpack(nvlbuf, nvlsize, &nvl, NV_ENCODE_NATIVE)) != 0)
+ if ((err = nvlist_unpack(nvlbuf, nvlsize, &nvl, 0)) != 0)
goto ret;
if (flags & (IPMGMT_ACTIVE|IPMGMT_INIT)) {
if ((err = i_ipmgmt_nvl2aobjnode(nvl, &node)) != 0)
@@ -668,7 +668,7 @@ ipmgmt_getaddr_handler(void *argp)
char *buf, *onvlbuf;
ipmgmt_getaddr_arg_t *gargp = argp;
ipmgmt_getaddr_cbarg_t cbarg;
- ipmgmt_get_rval_t rval, *rvalp = &rval;
+ ipmgmt_get_rval_t rval, *rvalp = &rval;
int err = 0;
cbarg.cb_ifname = gargp->ia_ifname;
@@ -813,7 +813,7 @@ ipmgmt_initif_handler(void *argp)
bzero(&cbarg, sizeof (cbarg));
invlbuf = (char *)argp + sizeof (ipmgmt_initif_arg_t);
nvlsize = initif->ia_nvlsize;
- err = nvlist_unpack(invlbuf, nvlsize, &cbarg.cb_invl, NV_ENCODE_NATIVE);
+ err = nvlist_unpack(invlbuf, nvlsize, &cbarg.cb_invl, 0);
if (err != 0)
goto fail;
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 49f5ead480..90c32092aa 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c
@@ -25,6 +25,7 @@
* MROUTING Revision 3.5
* Copyright 2018, Joyent, Inc.
* Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2021 Racktop Systems, Inc.
*/
/*
@@ -6025,6 +6026,7 @@ udp_report_item_v4(const mib2_udpEntry_t *ude, boolean_t first,
{
char *leadin;
char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
+ char fname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
/* hostname + portname */
proc_fdinfo_t *ph;
@@ -6052,7 +6054,7 @@ udp_report_item_v4(const mib2_udpEntry_t *ude, boolean_t first,
lname, sizeof (lname)),
ude->udpEntryInfo.ue_state == MIB2_UDP_connected ?
pr_ap(ude->udpEntryInfo.ue_RemoteAddress,
- ude->udpEntryInfo.ue_RemotePort, "udp", lname, sizeof (lname)) :
+ ude->udpEntryInfo.ue_RemotePort, "udp", fname, sizeof (fname)) :
"") == -1) {
fatal(1, "Out of memory");
}
@@ -6094,6 +6096,7 @@ udp_report_item_v6(const mib2_udp6Entry_t *ude6, boolean_t first,
{
char *leadin;
char lname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
+ char fname[MAXHOSTNAMELEN + MAXHOSTNAMELEN + 1];
/* hostname + portname */
char ifname[LIFNAMSIZ + 1];
const char *ifnamep;
@@ -6126,7 +6129,7 @@ udp_report_item_v6(const mib2_udp6Entry_t *ude6, boolean_t first,
ude6->udp6LocalPort, "udp", lname, sizeof (lname)),
ude6->udp6EntryInfo.ue_state == MIB2_UDP_connected ?
pr_ap6(&ude6->udp6EntryInfo.ue_RemoteAddress,
- ude6->udp6EntryInfo.ue_RemotePort, "udp", lname, sizeof (lname)) :
+ ude6->udp6EntryInfo.ue_RemotePort, "udp", fname, sizeof (fname)) :
"") == -1) {
fatal(1, "Out of memory");
}
diff --git a/usr/src/cmd/cpio/Makefile b/usr/src/cmd/cpio/Makefile
index 18c3a18cca..409fbef1fe 100644
--- a/usr/src/cmd/cpio/Makefile
+++ b/usr/src/cmd/cpio/Makefile
@@ -31,7 +31,6 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DSOLARIS_PRIVS
CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += $(CNOWARN_UNINIT)
# not linted
SMATCH=off
@@ -52,6 +51,4 @@ install: all $(ROOTPROG)
clean:
$(RM) $(OBJS)
-lint: lint_SRCS
-
include ../Makefile.targ
diff --git a/usr/src/cmd/cpio/cpio.c b/usr/src/cmd/cpio/cpio.c
index 3de636654c..e3dc9b398f 100644
--- a/usr/src/cmd/cpio/cpio.c
+++ b/usr/src/cmd/cpio/cpio.c
@@ -909,7 +909,7 @@ add_lnk(struct Lnk **sublist_return)
static int
bfill(void)
{
- int i = 0, rv;
+ int i = 0, rv = 0;
static int eof = 0;
if (!Dflag) {
@@ -2053,7 +2053,7 @@ static int
creat_tmp(char *nam_p)
{
char *t_p;
- int cwd;
+ int cwd = -1;
if ((Args & OCp) && G_p->g_ino == DesSt.st_ino &&
G_p->g_dev == DesSt.st_dev) {
@@ -4464,7 +4464,7 @@ gethdr(void)
{
ushort_t ftype;
int hit = NONE, cnt = 0;
- int goodhdr, hsize, offset;
+ int goodhdr, hsize = 0, offset;
int bswap = 0;
char *preptr;
int k = 0;
@@ -4880,7 +4880,7 @@ gethdr(void)
int pad;
int cnt;
char *tp;
- int attrsize;
+ int attrsize = 0;
if (Pflag) {
bytes = Gen.g_filesz;
@@ -5820,7 +5820,7 @@ read_hdr(int hdr)
int rv = NONE;
major_t maj, rmaj;
minor_t min, rmin;
- char tmpnull;
+ char tmpnull = '\0';
static int bar_read_cnt = 0;
if (hdr != BAR) {
@@ -6282,7 +6282,7 @@ rstfiles(int over, int dirfd)
/* Acl was not set, so we must chmod */
if (!acl_is_set) {
- mode_t orig_mask, new_mask;
+ mode_t orig_mask = 0, new_mask;
/*
* use fchmod for attributes, since
@@ -7127,8 +7127,8 @@ verbose(char *nam_p)
static void
write_hdr(int arcflag, off_t len)
{
- int cnt, pad;
- mode_t mode;
+ int cnt = 0, pad;
+ mode_t mode = 0;
uid_t uid;
gid_t gid;
const char warnfmt[] = "%s%s%s : %s";
@@ -8560,7 +8560,7 @@ prepare_xattr_hdr(
* length of filename + attr
* in link section
*/
- int linkstringlen;
+ int linkstringlen = 0;
int complen; /* length of pathing section */
int linklen; /* length of link section */
int attrnames_index; /* attrnames starting index */
@@ -9072,7 +9072,7 @@ sl_info_t *
sl_insert(dev_t device, ino_t inode, int ftype)
{
sl_info_t *p; /* moves down the tree */
- sl_info_t *q; /* scratch */
+ sl_info_t *q = NULL; /* scratch */
sl_info_t *r; /* scratch */
sl_info_t *s; /* pt where rebalancing may be needed */
sl_info_t *t; /* father of s */
diff --git a/usr/src/lib/fm/topo/modules/common/pcibus/pcibus.c b/usr/src/lib/fm/topo/modules/common/pcibus/pcibus.c
index 92c5b721e9..99a959c535 100644
--- a/usr/src/lib/fm/topo/modules/common/pcibus/pcibus.c
+++ b/usr/src/lib/fm/topo/modules/common/pcibus/pcibus.c
@@ -255,8 +255,7 @@ pciexfn_add_ufm(topo_mod_t *mod, tnode_t *parent, tnode_t *node)
}
(void) close(fd);
- if (nvlist_unpack(ufmr.ufmr_buf, ufmr.ufmr_bufsz, &ufminfo,
- NV_ENCODE_NATIVE) != 0) {
+ if (nvlist_unpack(ufmr.ufmr_buf, ufmr.ufmr_bufsz, &ufminfo, 0) != 0) {
topo_mod_dprintf(mod, "failed to unpack nvlist\n");
topo_mod_free(mod, ufmr.ufmr_buf, ufmr.ufmr_bufsz);
return (topo_mod_seterrno(mod, EMOD_UNKNOWN));
diff --git a/usr/src/lib/libdladm/common/libdlmgmt.c b/usr/src/lib/libdladm/common/libdlmgmt.c
index 8f999d8b9c..51f2fe130c 100644
--- a/usr/src/lib/libdladm/common/libdlmgmt.c
+++ b/usr/src/lib/libdladm/common/libdlmgmt.c
@@ -400,7 +400,7 @@ again:
confp->ds_readonly = B_TRUE;
nvlbuf = (char *)retvalp + sizeof (dlmgmt_getconfsnapshot_retval_t);
if ((err = nvlist_unpack(nvlbuf, retvalp->lr_nvlsz,
- &(confp->ds_nvl), NV_ENCODE_NATIVE)) != 0) {
+ &(confp->ds_nvl), 0)) != 0) {
status = dladm_errno2status(err);
}
free(retvalp);
diff --git a/usr/src/lib/libipadm/common/ipadm_addr.c b/usr/src/lib/libipadm/common/ipadm_addr.c
index 0b1de43c14..4bca7ecb4f 100644
--- a/usr/src/lib/libipadm/common/ipadm_addr.c
+++ b/usr/src/lib/libipadm/common/ipadm_addr.c
@@ -1672,7 +1672,7 @@ ipadm_set_addrprop(ipadm_handle_t iph, const char *pname,
ipadm_prop_desc_t *pdp = NULL;
char defbuf[MAXPROPVALLEN];
uint_t defbufsize = MAXPROPVALLEN;
- boolean_t reset = (pflags & IPADM_OPT_DEFAULT);
+ boolean_t reset = (pflags & IPADM_OPT_DEFAULT);
ipadm_status_t status = IPADM_SUCCESS;
/* Check for solaris.network.interface.config authorization */
@@ -2391,7 +2391,7 @@ ipadm_create_addrobj(ipadm_addr_type_t type, const char *aobjname,
ipadm_status_t status;
char *aname, *cp;
char ifname[IPADM_AOBJSIZ];
- ifspec_t ifsp;
+ ifspec_t ifsp;
if (ipaddr == NULL)
return (IPADM_INVALID_ARG);
@@ -2615,7 +2615,7 @@ i_ipadm_get_db_addr(ipadm_handle_t iph, const char *ifname,
if (err == 0) {
nvlsize = rvalp->ir_nvlsize;
nvlbuf = (char *)rvalp + sizeof (ipmgmt_get_rval_t);
- err = nvlist_unpack(nvlbuf, nvlsize, onvl, NV_ENCODE_NATIVE);
+ err = nvlist_unpack(nvlbuf, nvlsize, onvl, 0);
}
free(rvalp);
return (ipadm_errno2status(err));
diff --git a/usr/src/lib/libipadm/common/libipadm.c b/usr/src/lib/libipadm/common/libipadm.c
index 9d57e1f16d..9ef32f35c1 100644
--- a/usr/src/lib/libipadm/common/libipadm.c
+++ b/usr/src/lib/libipadm/common/libipadm.c
@@ -826,7 +826,7 @@ i_ipadm_init_ifs(ipadm_handle_t iph, const char *ifs, nvlist_t **allifs)
* configuration information for the given interface(s).
*/
err = nvlist_unpack((char *)rvalp + sizeof (ipmgmt_get_rval_t),
- rvalp->ir_nvlsize, allifs, NV_ENCODE_NATIVE);
+ rvalp->ir_nvlsize, allifs, 0);
if (err != 0)
status = ipadm_errno2status(err);
done:
diff --git a/usr/src/lib/libmtmalloc/Makefile.com b/usr/src/lib/libmtmalloc/Makefile.com
index e859cee11d..534f01b0aa 100644
--- a/usr/src/lib/libmtmalloc/Makefile.com
+++ b/usr/src/lib/libmtmalloc/Makefile.com
@@ -40,8 +40,6 @@ CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
CPPFLAGS += -I../common -I../../common/inc -D_REENTRANT
DYNFLAGS += $(ZINTERPOSE)
-CERRWARN += $(CNOWARN_UNINIT)
-
.KEEP_STATE:
all: $(LIBS)
diff --git a/usr/src/lib/libmtmalloc/common/mtmalloc.c b/usr/src/lib/libmtmalloc/common/mtmalloc.c
index 0cf998c952..234bb988af 100644
--- a/usr/src/lib/libmtmalloc/common/mtmalloc.c
+++ b/usr/src/lib/libmtmalloc/common/mtmalloc.c
@@ -1316,9 +1316,9 @@ static void
add_oversize(oversize_t *lp)
{
int merge_flags = INSERT_ONLY;
- oversize_t *nx; /* ptr to item right of insertion point */
- oversize_t *pv; /* ptr to item left of insertion point */
- uint_t size_lp, size_pv, size_nx;
+ oversize_t *nx; /* ptr to item right of insertion point */
+ oversize_t *pv; /* ptr to item left of insertion point */
+ uint_t size_lp, size_pv, size_nx = 0;
uintptr_t endp_lp, endp_pv, endp_nx;
/*
diff --git a/usr/src/man/man9f/va_arg.9f b/usr/src/man/man9f/va_arg.9f
index 580a2f975c..4e133c6b74 100644
--- a/usr/src/man/man9f/va_arg.9f
+++ b/usr/src/man/man9f/va_arg.9f
@@ -4,7 +4,7 @@
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH VA_ARG 9F "Mar 21, 2017"
+.TH VA_ARG 9F "May 12, 2021"
.SH NAME
va_arg, va_start, va_copy, va_end \- handle variable argument list
.SH SYNOPSIS
@@ -18,7 +18,7 @@ va_arg, va_start, va_copy, va_end \- handle variable argument list
.LP
.nf
-\fB(type *)\fR \fBva_arg\fR(\fBva_list\fR \fIpvar\fR, \fB\fR\fItype\fR);
+\fBtype\fR \fBva_arg\fR(\fBva_list\fR \fIpvar\fR, \fB\fR\fItype\fR);
.fi
.LP
diff --git a/usr/src/uts/common/io/ufmtest.c b/usr/src/uts/common/io/ufmtest.c
index ea9bb115d5..25c4af8fee 100644
--- a/usr/src/uts/common/io/ufmtest.c
+++ b/usr/src/uts/common/io/ufmtest.c
@@ -266,7 +266,7 @@ ufmtest_do_setfw(intptr_t data, int mode)
}
ret = nvlist_unpack(nvlbuf, setfw.utsw_bufsz, &ufmt.ufmt_nvl,
- NV_ENCODE_NATIVE);
+ KM_NOSLEEP);
kmem_free(nvlbuf, setfw.utsw_bufsz);
if (ret != 0)