diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-06 21:22:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-06 21:22:32 +0000 |
commit | 3542bb2c425c1d7e2cd5edfc7a12a00318717cbb (patch) | |
tree | 2fab785f153b0db60dbd76d149177f3d3f32995f | |
parent | f167df2e15cf4f787bf7d66068fd38a330d92d15 (diff) |
strlcpy
-rw-r--r-- | usr.bin/encrypt/encrypt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/encrypt/encrypt.c b/usr.bin/encrypt/encrypt.c index ab1e954cb78..2c600aa4a20 100644 --- a/usr.bin/encrypt/encrypt.c +++ b/usr.bin/encrypt/encrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: encrypt.c,v 1.16 2002/02/16 21:27:45 millert Exp $ */ +/* $OpenBSD: encrypt.c,v 1.17 2003/04/06 21:22:31 deraadt Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -94,15 +94,15 @@ print_passwd(char *string, int operation, void *extra) /* To be compatible... */ errx(1, "%s", strerror(EFTYPE)); } - strcpy(msalt, &string[8]); + strlcpy(msalt, &string[8], sizeof msalt); salt = msalt; break; case DO_MD5: - strcpy(buffer, "$1$"); + strlcpy(buffer, "$1$", sizeof buffer); to64(&buffer[3], arc4random(), 4); to64(&buffer[7], arc4random(), 4); - strcpy(buffer + 11, "$"); + strlcpy(buffer + 11, "$", sizeof buffer - 11); salt = buffer; break; |