diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-04 00:42:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-04 00:42:35 +0000 |
commit | daf329b1c0f01bbdd4028168949c69860a248f9e (patch) | |
tree | ca613584d0fe67c96c9239325b37011daa2ef3cc /usr.bin/sectok | |
parent | 51ea99310ccd7f074f3727add189ec97cde8b868 (diff) |
snprintf & strlcpy; tedu ok
Diffstat (limited to 'usr.bin/sectok')
-rw-r--r-- | usr.bin/sectok/cmds.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/sectok/cmds.c b/usr.bin/sectok/cmds.c index 99e691bc371..fd3e709c22b 100644 --- a/usr.bin/sectok/cmds.c +++ b/usr.bin/sectok/cmds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmds.c,v 1.20 2002/06/17 07:10:52 deraadt Exp $ */ +/* $OpenBSD: cmds.c,v 1.21 2003/04/04 00:42:34 deraadt Exp $ */ /* * Smartcard commander. @@ -580,6 +580,7 @@ chpin(int argc, char *argv[]) { int keyno = 1, i, sw; char pin[255]; + char *pass; optind = optreset = 1; @@ -591,8 +592,10 @@ chpin(int argc, char *argv[]) } } - strcpy(pin, getpass("Enter Old PIN: ")); - strcat(pin, getpass("Enter New PIN: ")); + pass = getpass("Enter Old PIN: "); + strlcpy(pin, pass, sizeof pin); + pass = getpass("Enter New PIN: "); + strlcat(pin, pass, sizeof pin); sectok_apdu(fd, cla, 0x24, 0, keyno, strlen(pin), pin, 0, NULL, &sw); bzero(pin, strlen(pin)); |