summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-add.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-09-29 21:14:15 +0000
committerderaadt <deraadt@openbsd.org>1999-09-29 21:14:15 +0000
commit53af70e769722a1c2fd6f1a4c707f4d25d07bcfa (patch)
tree171427288700ad148448f9ab573536829996c005 /usr.bin/ssh/ssh-add.c
parentReallocate our scrollback buffer when switching 132/80 column modes, too. (diff)
downloadwireguard-openbsd-53af70e769722a1c2fd6f1a4c707f4d25d07bcfa.tar.xz
wireguard-openbsd-53af70e769722a1c2fd6f1a4c707f4d25d07bcfa.zip
numerous sprintf, strncpy, strcpy cleanups
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r--usr.bin/ssh/ssh-add.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index f5cd92ba159..65bf4fbb2cc 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -14,7 +14,7 @@ Adds an identity to the authentication server, or removes an identity.
*/
#include "includes.h"
-RCSID("$Id: ssh-add.c,v 1.3 1999/09/29 06:15:00 deraadt Exp $");
+RCSID("$Id: ssh-add.c,v 1.4 1999/09/29 21:14:16 deraadt Exp $");
#include "rsa.h"
#include "ssh.h"
@@ -110,7 +110,8 @@ add_file(const char *filename)
/* Ask for a passphrase. */
if (getenv("DISPLAY") && !isatty(fileno(stdin)))
{
- sprintf(buf, "ssh-askpass '%sEnter passphrase for %.100s'",
+ snprintf(buf, sizeof buf,
+ "ssh-askpass '%sEnter passphrase for %.100s'",
first ? "" : "You entered wrong passphrase. ",
saved_comment);
f = popen(buf, "r");
@@ -259,7 +260,7 @@ main(int ac, char **av)
fprintf(stderr, "No user found with uid %d\n", (int)getuid());
exit(1);
}
- sprintf(buf, "%s/%s", pw->pw_dir, SSH_CLIENT_IDENTITY);
+ snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, SSH_CLIENT_IDENTITY);
if (deleting)
delete_file(buf);
else