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/lib | |
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/lib')
-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 |
3 files changed, 11 insertions, 11 deletions
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); |