diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | log.c | 4 | ||||
-rw-r--r-- | schnorr.c | 12 | ||||
-rw-r--r-- | scp.c | 4 | ||||
-rw-r--r-- | serverloop.c | 4 | ||||
-rw-r--r-- | sftp.c | 4 | ||||
-rw-r--r-- | sshd.c | 5 |
7 files changed, 22 insertions, 15 deletions
@@ -43,6 +43,10 @@ | |||
43 | - jmc@cvs.openbsd.org 2013/05/16 06:30:06 | 43 | - jmc@cvs.openbsd.org 2013/05/16 06:30:06 |
44 | [sshd_config.5] | 44 | [sshd_config.5] |
45 | oops! avoid Xr to self; | 45 | oops! avoid Xr to self; |
46 | - dtucker@cvs.openbsd.org 2013/05/16 09:08:41 | ||
47 | [log.c scp.c sshd.c serverloop.c schnorr.c sftp.c] | ||
48 | Fix some "unused result" warnings found via clang and -portable. | ||
49 | ok markus@ | ||
46 | 50 | ||
47 | 20130510 | 51 | 20130510 |
48 | - (dtucker) [configure.ac] Enable -Wsizeof-pointer-memaccess if the compiler | 52 | - (dtucker) [configure.ac] Enable -Wsizeof-pointer-memaccess if the compiler |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.44 2013/04/07 02:10:33 dtucker Exp $ */ | 1 | /* $OpenBSD: log.c,v 1.45 2013/05/16 09:08:41 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -445,7 +445,7 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
445 | log_handler = tmp_handler; | 445 | log_handler = tmp_handler; |
446 | } else if (log_on_stderr) { | 446 | } else if (log_on_stderr) { |
447 | snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); | 447 | snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); |
448 | write(log_stderr_fd, msgbuf, strlen(msgbuf)); | 448 | (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); |
449 | } else { | 449 | } else { |
450 | #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) | 450 | #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) |
451 | openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); | 451 | openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: schnorr.c,v 1.5 2010/12/03 23:49:26 djm Exp $ */ | 1 | /* $OpenBSD: schnorr.c,v 1.6 2013/05/16 09:08:41 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2008 Damien Miller. All rights reserved. | 3 | * Copyright (c) 2008 Damien Miller. All rights reserved. |
4 | * | 4 | * |
@@ -488,12 +488,13 @@ debug3_bn(const BIGNUM *n, const char *fmt, ...) | |||
488 | { | 488 | { |
489 | char *out, *h; | 489 | char *out, *h; |
490 | va_list args; | 490 | va_list args; |
491 | int ret; | ||
491 | 492 | ||
492 | out = NULL; | 493 | out = NULL; |
493 | va_start(args, fmt); | 494 | va_start(args, fmt); |
494 | vasprintf(&out, fmt, args); | 495 | ret = vasprintf(&out, fmt, args); |
495 | va_end(args); | 496 | va_end(args); |
496 | if (out == NULL) | 497 | if (ret == -1 || out == NULL) |
497 | fatal("%s: vasprintf failed", __func__); | 498 | fatal("%s: vasprintf failed", __func__); |
498 | 499 | ||
499 | if (n == NULL) | 500 | if (n == NULL) |
@@ -513,12 +514,13 @@ debug3_buf(const u_char *buf, u_int len, const char *fmt, ...) | |||
513 | char *out, h[65]; | 514 | char *out, h[65]; |
514 | u_int i, j; | 515 | u_int i, j; |
515 | va_list args; | 516 | va_list args; |
517 | int ret; | ||
516 | 518 | ||
517 | out = NULL; | 519 | out = NULL; |
518 | va_start(args, fmt); | 520 | va_start(args, fmt); |
519 | vasprintf(&out, fmt, args); | 521 | ret = vasprintf(&out, fmt, args); |
520 | va_end(args); | 522 | va_end(args); |
521 | if (out == NULL) | 523 | if (ret == -1 || out == NULL) |
522 | fatal("%s: vasprintf failed", __func__); | 524 | fatal("%s: vasprintf failed", __func__); |
523 | 525 | ||
524 | debug3("%s length %u%s", out, len, buf == NULL ? " (null)" : ""); | 526 | debug3("%s length %u%s", out, len, buf == NULL ? " (null)" : ""); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: scp.c,v 1.171 2011/09/09 22:37:01 djm Exp $ */ | 1 | /* $OpenBSD: scp.c,v 1.172 2013/05/16 09:08:41 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * scp - secure remote copy. This is basically patched BSD rcp which | 3 | * scp - secure remote copy. This is basically patched BSD rcp which |
4 | * uses ssh to do the data transfer (instead of using rcmd). | 4 | * uses ssh to do the data transfer (instead of using rcmd). |
@@ -1325,7 +1325,7 @@ void | |||
1325 | lostconn(int signo) | 1325 | lostconn(int signo) |
1326 | { | 1326 | { |
1327 | if (!iamremote) | 1327 | if (!iamremote) |
1328 | write(STDERR_FILENO, "lost connection\n", 16); | 1328 | (void)write(STDERR_FILENO, "lost connection\n", 16); |
1329 | if (signo) | 1329 | if (signo) |
1330 | _exit(1); | 1330 | _exit(1); |
1331 | else | 1331 | else |
diff --git a/serverloop.c b/serverloop.c index 595899f61..a61d4ad32 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: serverloop.c,v 1.165 2013/05/16 04:09:14 dtucker Exp $ */ | 1 | /* $OpenBSD: serverloop.c,v 1.166 2013/05/16 09:08:41 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -148,7 +148,7 @@ static void | |||
148 | notify_parent(void) | 148 | notify_parent(void) |
149 | { | 149 | { |
150 | if (notify_pipe[1] != -1) | 150 | if (notify_pipe[1] != -1) |
151 | write(notify_pipe[1], "", 1); | 151 | (void)write(notify_pipe[1], "", 1); |
152 | } | 152 | } |
153 | static void | 153 | static void |
154 | notify_prepare(fd_set *readset) | 154 | notify_prepare(fd_set *readset) |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp.c,v 1.143 2013/04/18 02:16:07 djm Exp $ */ | 1 | /* $OpenBSD: sftp.c,v 1.144 2013/05/16 09:08:41 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> | 3 | * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> |
4 | * | 4 | * |
@@ -218,7 +218,7 @@ cmd_interrupt(int signo) | |||
218 | const char msg[] = "\rInterrupt \n"; | 218 | const char msg[] = "\rInterrupt \n"; |
219 | int olderrno = errno; | 219 | int olderrno = errno; |
220 | 220 | ||
221 | write(STDERR_FILENO, msg, sizeof(msg) - 1); | 221 | (void)write(STDERR_FILENO, msg, sizeof(msg) - 1); |
222 | interrupted = 1; | 222 | interrupted = 1; |
223 | errno = olderrno; | 223 | errno = olderrno; |
224 | } | 224 | } |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.400 2013/05/16 04:09:14 dtucker Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.401 2013/05/16 09:08:41 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1815,7 +1815,8 @@ main(int ac, char **av) | |||
1815 | 1815 | ||
1816 | /* Chdir to the root directory so that the current disk can be | 1816 | /* Chdir to the root directory so that the current disk can be |
1817 | unmounted if desired. */ | 1817 | unmounted if desired. */ |
1818 | chdir("/"); | 1818 | if (chdir("/") == -1) |
1819 | error("chdir(\"/\"): %s", strerror(errno)); | ||
1819 | 1820 | ||
1820 | /* ignore SIGPIPE */ | 1821 | /* ignore SIGPIPE */ |
1821 | signal(SIGPIPE, SIG_IGN); | 1822 | signal(SIGPIPE, SIG_IGN); |