From 3ccc36b3b74018a49b6924f3328362003861c18b Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 15 Mar 2016 23:03:31 +0800 Subject: [PATCH 1/4] Fix truncated type for getc() at confirmation prompt --- cli-kex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli-kex.c b/cli-kex.c index 077fec9..936b95c 100644 --- a/cli-kex.c +++ b/cli-kex.c @@ -186,7 +186,7 @@ static void ask_to_confirm(unsigned char* keyblob, unsigned int keybloblen, char* fp = NULL; FILE *tty = NULL; - char response = 'z'; + int response = 'z'; fp = sign_key_fingerprint(keyblob, keybloblen); if (cli_opts.always_accept_key) { From 6b5c6af613964f5c230225e9467adbe081e8ae83 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 15 Mar 2016 23:03:43 +0800 Subject: [PATCH 2/4] ignore return value from fcntl() --- cli-session.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli-session.c b/cli-session.c index a93d192..31c9f02 100644 --- a/cli-session.c +++ b/cli-session.c @@ -361,9 +361,10 @@ static void cli_session_cleanup(void) { /* Set std{in,out,err} back to non-blocking - busybox ash dies nastily if * we don't revert the flags */ - fcntl(cli_ses.stdincopy, F_SETFL, cli_ses.stdinflags); - fcntl(cli_ses.stdoutcopy, F_SETFL, cli_ses.stdoutflags); - fcntl(cli_ses.stderrcopy, F_SETFL, cli_ses.stderrflags); + /* Ignore return value since there's nothing we can do */ + (void)fcntl(cli_ses.stdincopy, F_SETFL, cli_ses.stdinflags); + (void)fcntl(cli_ses.stdoutcopy, F_SETFL, cli_ses.stdoutflags); + (void)fcntl(cli_ses.stderrcopy, F_SETFL, cli_ses.stderrflags); cli_tty_cleanup(); From c67fc5693a8e4f88e83499a7fc7316c7ad5095ef Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 15 Mar 2016 23:03:59 +0800 Subject: [PATCH 3/4] m_close() rather than close() --- svr-x11fwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr-x11fwd.c b/svr-x11fwd.c index 2af4141..cf213e8 100644 --- a/svr-x11fwd.c +++ b/svr-x11fwd.c @@ -119,7 +119,7 @@ fail: /* cleanup */ m_free(chansess->x11authprot); m_free(chansess->x11authcookie); - close(fd); + m_close(fd); return DROPBEAR_FAILURE; } From 098aba47c33f4095ab185627fa7473d2954a678e Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 15 Mar 2016 23:20:01 +0800 Subject: [PATCH 4/4] assertion for case that shouldn't happen --- svr-kex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svr-kex.c b/svr-kex.c index 96f4508..f3828aa 100644 --- a/svr-kex.c +++ b/svr-kex.c @@ -138,7 +138,7 @@ static void svr_ensure_hostkey() { break; #endif default: - (void)0; + dropbear_assert(0); } if (readhostkey(fn, svr_opts.hostkey, &type) == DROPBEAR_SUCCESS) {