changeset 24453:26e87d5dd27f

[illumos-gate merge] commit 77ac0eaaa1298f1119c62575dcdb2003d56e0994 12160 libdiskstatus: argument to 'alloca' may be too large commit 7e536b59b5c21c385f301967cb3b7e31d307d131 11982 libmail: cast between incompatible function types commit 0639c0edfe5fac11628e478be2a3b2d88556fc80 12150 loader: warning: 'alloc_align' attribute ignored on a function returning 'int' commit 4e5ef1cee66fbfbbd2b3e56b81e2bb5700f4a59e 12156 libsasl: 'prev' may be used uninitialized in this function commit 1081175181bc5c4495f7bc7f565bf3af4f1d6085 12171 pbchk traceback when checking .java file under python3
author Jerry Jelinek <jerry.jelinek@joyent.com>
date Thu, 09 Jan 2020 12:20:27 +0000
parents 00b1166f2457 (current diff) 4afdede50c0c (diff)
children 0802336e9015
files usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c usr/src/tools/scripts/git-pbchk.py
diffstat 5 files changed, 14 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/include/stdlib.h	Wed Jan 08 12:49:48 2020 +0000
+++ b/usr/src/boot/include/stdlib.h	Thu Jan 09 12:20:27 2020 +0000
@@ -172,8 +172,7 @@
 int	 rand_r(unsigned *);			/* (TSF) */
 #endif
 #if __POSIX_VISIBLE >= 200112
-int	 posix_memalign(void **, size_t, size_t) __nonnull(1) __alloc_align(2)
-	    __alloc_size(3);			/* (ADV) */
+int	 posix_memalign(void **, size_t, size_t);  /* (ADV) */
 int	 setenv(const char *, const char *, int);
 int	 unsetenv(const char *);
 #endif
--- a/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c	Wed Jan 08 12:49:48 2020 +0000
+++ b/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c	Thu Jan 09 12:20:27 2020 +0000
@@ -1615,12 +1615,13 @@
 	if (page_size < sizeof (scsi_log_header_t))
 		return (-1);
 
-	log_sense_buf = alloca((uint_t)page_size);
+	log_sense_buf = calloc(1, page_size);
+	if (log_sense_buf == NULL)
+		return (-1);
 
 	/*
 	 * Build and execute the uscsi ioctl
 	 */
-	(void) memset(log_sense_buf, 0, page_size);
 	(void) memset((char *)&ucmd, 0, sizeof (ucmd));
 	(void) memset((char *)&cdb, 0, sizeof (union scsi_cdb));
 	cdb.scc_cmd = SCMD_LOG_SENSE_G1;
@@ -1633,6 +1634,7 @@
 	status = uscsi_cmd(fd, &ucmd, rqbuf, rqblen);
 	if (status) {
 		dprintf("Log sense page 0x%x failed\n", page_code);
+		free(log_sense_buf);
 		return (-1);
 	}
 
@@ -1651,6 +1653,7 @@
 		dprintf("\nLog sense page 0x%x: incorrect page code 0x%x\n",
 		    page_code, hdr->lh_code);
 		ddump("Log sense:", log_sense_buf, page_size);
+		free(log_sense_buf);
 		return (-1);
 	}
 
@@ -1672,6 +1675,7 @@
 	    sizeof (scsi_log_header_t));
 	ddump("data:", (caddr_t)hdr +
 	    sizeof (scsi_log_header_t), len);
+	free(log_sense_buf);
 
 	return (0);
 }
--- a/usr/src/lib/libmail/common/notifyu.c	Wed Jan 08 12:49:48 2020 +0000
+++ b/usr/src/lib/libmail/common/notifyu.c	Thu Jan 09 12:20:27 2020 +0000
@@ -25,9 +25,7 @@
  */
 
 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+/*	  All Rights Reserved	*/
 
 #include "libmail.h"
 #include <sys/types.h>
@@ -41,12 +39,10 @@
 #include <unistd.h>
 #include <signal.h>
 
-static SIG_PF catcher(void);
-
-static SIG_PF catcher(void)
+static void
+catcher(int arg __unused)
 {
 	/* do nothing, but allow the write() to break */
-	return (0);
 }
 
 void
@@ -77,7 +73,7 @@
 			(void) sprintf(dev, "%s/dev/%s", etcdir, tty);
 
 			/* break out if write() to the tty hangs */
-			old = (SIG_PF)signal(SIGALRM, (SIG_PF)catcher);
+			old = (SIG_PF)signal(SIGALRM, catcher);
 			oldalarm = alarm(300);
 
 			/* check if device is really a tty */
--- a/usr/src/lib/libsasl/lib/common.c	Wed Jan 08 12:49:48 2020 +0000
+++ b/usr/src/lib/libsasl/lib/common.c	Thu Jan 09 12:20:27 2020 +0000
@@ -1301,7 +1301,7 @@
 
 int _is_sun_reg(void *mech)
 {
-	reg_list_t *r, *prev;
+	reg_list_t *r, *prev = NULL;
 	int is_reg = 0;
 
 	LOCK_MUTEX(&reg_mutex);
--- a/usr/src/tools/scripts/git-pbchk.py	Wed Jan 08 12:49:48 2020 +0000
+++ b/usr/src/tools/scripts/git-pbchk.py	Thu Jan 09 12:20:27 2020 +0000
@@ -21,7 +21,7 @@
 # Copyright (c) 2015, 2016 by Delphix. All rights reserved.
 # Copyright 2016 Nexenta Systems, Inc.
 # Copyright (c) 2019, Joyent, Inc.
-# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
 #
 
 from __future__ import print_function
@@ -280,7 +280,7 @@
     ret = 0
     output.write("Java style:\n")
     for f in flist(lambda x: x.endswith('.java')):
-        with io.open(f, encoding='utf-8', errors='replace') as fh:
+        with io.open(f, mode='rb') as fh:
             ret |= JStyle.jstyle(fh, output=output, picky=True)
     return ret