summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-09 08:54:31 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-09 08:54:31 +1100
commit340d1688e658e85a3c45270bc3fca4e6d1aee9b1 (patch)
tree48a376901c26bc814a67dd45776a819b7c480c43
parent1a8f535b970738f8de7599d5815d3be3beaa3b48 (diff)
- dtucker@cvs.openbsd.org 2010/01/08 21:50:49
[sftp.c] Fix two warnings: possibly used unitialized and use a nul byte instead of NULL pointer. ok djm@
-rw-r--r--ChangeLog4
-rw-r--r--sftp.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 11093e7ad..b1350dc35 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -154,6 +154,10 @@
154 [sftp-server.c] 154 [sftp-server.c]
155 bz#1566 don't unnecessarily dup() in and out fds for sftp-server; 155 bz#1566 don't unnecessarily dup() in and out fds for sftp-server;
156 ok markus@ 156 ok markus@
157 - dtucker@cvs.openbsd.org 2010/01/08 21:50:49
158 [sftp.c]
159 Fix two warnings: possibly used unitialized and use a nul byte instead of
160 NULL pointer. ok djm@
157 - (dtucker) [Makefile.in added roaming_client.c roaming_serv.c] Import new 161 - (dtucker) [Makefile.in added roaming_client.c roaming_serv.c] Import new
158 files for roaming and add to Makefile. 162 files for roaming and add to Makefile.
159 - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines. 163 - (dtucker) [Makefile.in] .c files do not belong in the OBJ lines.
diff --git a/sftp.c b/sftp.c
index 4b12fae4b..9f5fa354d 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.116 2010/01/04 02:03:57 djm Exp $ */ 1/* $OpenBSD: sftp.c,v 1.117 2010/01/08 21:50:49 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 *
@@ -1568,7 +1568,7 @@ complete_ambiguous(const char *word, char **list, size_t count)
1568 if (matchlen > strlen(word)) { 1568 if (matchlen > strlen(word)) {
1569 char *tmp = xstrdup(list[0]); 1569 char *tmp = xstrdup(list[0]);
1570 1570
1571 tmp[matchlen] = NULL; 1571 tmp[matchlen] = '\0';
1572 return tmp; 1572 return tmp;
1573 } 1573 }
1574 } 1574 }
@@ -2062,7 +2062,7 @@ int
2062main(int argc, char **argv) 2062main(int argc, char **argv)
2063{ 2063{
2064 int in, out, ch, err; 2064 int in, out, ch, err;
2065 char *host, *userhost, *cp, *file2 = NULL; 2065 char *host = NULL, *userhost, *cp, *file2 = NULL;
2066 int debug_level = 0, sshver = 2; 2066 int debug_level = 0, sshver = 2;
2067 char *file1 = NULL, *sftp_server = NULL; 2067 char *file1 = NULL, *sftp_server = NULL;
2068 char *ssh_program = _PATH_SSH_PROGRAM, *sftp_direct = NULL; 2068 char *ssh_program = _PATH_SSH_PROGRAM, *sftp_direct = NULL;