diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-01-09 12:20:27 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-01-09 12:20:27 +0000 |
commit | c2e53e4331d7069621f6df5fc7b73c4dbc20ec67 (patch) | |
tree | cb698ee4c299c1e4e354c9b54795f94f92e42760 /usr/src | |
parent | e3d7b93d28e9956dcafe193469a2149566707527 (diff) | |
parent | 77ac0eaaa1298f1119c62575dcdb2003d56e0994 (diff) | |
download | illumos-joyent-c2e53e4331d7069621f6df5fc7b73c4dbc20ec67.tar.gz |
[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
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/boot/include/stdlib.h | 3 | ||||
-rw-r--r-- | usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c | 8 | ||||
-rw-r--r-- | usr/src/lib/libmail/common/notifyu.c | 12 | ||||
-rw-r--r-- | usr/src/lib/libsasl/lib/common.c | 2 | ||||
-rw-r--r-- | usr/src/tools/scripts/git-pbchk.py | 4 |
5 files changed, 14 insertions, 15 deletions
diff --git a/usr/src/boot/include/stdlib.h b/usr/src/boot/include/stdlib.h index d5506ff65e..b8708a27a5 100644 --- a/usr/src/boot/include/stdlib.h +++ b/usr/src/boot/include/stdlib.h @@ -172,8 +172,7 @@ char *realpath(const char * __restrict, char * __restrict); 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 diff --git a/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c b/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c index 1c73c959ea..3211e65dfc 100644 --- a/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c +++ b/usr/src/lib/fm/libdiskstatus/common/ds_scsi_uscsi.c @@ -1615,12 +1615,13 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, 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 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, 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 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, 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 @@ uscsi_log_sense(int fd, int page_code, int page_control, caddr_t page_data, sizeof (scsi_log_header_t)); ddump("data:", (caddr_t)hdr + sizeof (scsi_log_header_t), len); + free(log_sense_buf); return (0); } diff --git a/usr/src/lib/libmail/common/notifyu.c b/usr/src/lib/libmail/common/notifyu.c index 9d4b7d4694..1cbeb583fc 100644 --- a/usr/src/lib/libmail/common/notifyu.c +++ b/usr/src/lib/libmail/common/notifyu.c @@ -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 @@ typedef void (*SIG_PF) (int); #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 @@ notify(char *user, char *msg, int check_mesg_y, char *etcdir) (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 */ diff --git a/usr/src/lib/libsasl/lib/common.c b/usr/src/lib/libsasl/lib/common.c index b4fe5d1d86..e91a5b5508 100644 --- a/usr/src/lib/libsasl/lib/common.c +++ b/usr/src/lib/libsasl/lib/common.c @@ -1301,7 +1301,7 @@ static reg_list_t *reg_list_base = NULL; int _is_sun_reg(void *mech) { - reg_list_t *r, *prev; + reg_list_t *r, *prev = NULL; int is_reg = 0; LOCK_MUTEX(®_mutex); diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index 99bce29087..ec01255c6e 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -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 @@ def jstyle(root, parent, flist, output): 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 |