summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2007-12-02 13:21:16 +0100
committerDarren Tucker <dtucker@zip.com.au>2007-12-02 13:21:16 +0100
commite143f062ba1ee0d38c583acd6a8fbc8e679f45a3 (patch)
treee62014f77cf8242611c8abc696ee3bf1094886df
parent - deraadt@cvs.openbsd.org 2007/11/03 01:24:06 (diff)
downloadopenssh-e143f062ba1ee0d38c583acd6a8fbc8e679f45a3.tar.xz
openssh-e143f062ba1ee0d38c583acd6a8fbc8e679f45a3.zip
- dtucker@cvs.openbsd.org 2007/11/03 02:00:32
[ssh.c] Use xstrdup/xfree when saving pwname and pwdir; ok deraadt@
-rw-r--r--ChangeLog5
-rw-r--r--ssh.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d820cae7..f3c118cf7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,9 @@
bz #1377: getpwuid results were being clobbered by another getpw* call
inside tilde_expand_filename(); save the data we need carefully
ok djm
+ - dtucker@cvs.openbsd.org 2007/11/03 02:00:32
+ [ssh.c]
+ Use xstrdup/xfree when saving pwname and pwdir; ok deraadt@
20071030
- (djm) OpenBSD CVS Sync
@@ -3452,4 +3455,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@
-$Id: ChangeLog,v 1.4804 2007/12/02 12:16:32 dtucker Exp $
+$Id: ChangeLog,v 1.4805 2007/12/02 12:21:16 dtucker Exp $
diff --git a/ssh.c b/ssh.c
index f9c6252d3..7e23acff6 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.306 2007/11/03 01:24:06 deraadt Exp $ */
+/* $OpenBSD: ssh.c,v 1.307 2007/11/03 02:00:32 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1260,8 +1260,8 @@ load_public_identity_files(void)
#endif /* SMARTCARD */
if ((pw = getpwuid(original_real_uid)) == NULL)
fatal("load_public_identity_files: getpwuid failed");
- pwname = strdup(pw->pw_name);
- pwdir = strdup(pw->pw_dir);
+ pwname = xstrdup(pw->pw_name);
+ pwdir = xstrdup(pw->pw_dir);
if (gethostname(thishost, sizeof(thishost)) == -1)
fatal("load_public_identity_files: gethostname: %s",
strerror(errno));
@@ -1280,9 +1280,9 @@ load_public_identity_files(void)
options.identity_keys[i] = public;
}
bzero(pwname, strlen(pwname));
- free(pwname);
+ xfree(pwname);
bzero(pwdir, strlen(pwdir));
- free(pwdir);
+ xfree(pwdir);
}
static void