use strlcat/strlcpy, from openbsd

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12048 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-04-16 16:19:33 +00:00
parent 470fe54cee
commit 70a07c093d

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1995 - 2002 Kungliga Tekniska H<>gskolan * Copyright (c) 1995 - 2003 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -97,9 +97,9 @@ otp_md_init (OtpKey key,
p = malloc (len + 1); p = malloc (len + 1);
if (p == NULL) if (p == NULL)
return -1; return -1;
strcpy (p, seed); strlcpy (p, seed, len + 1);
strlwr (p); strlwr (p);
strcat (p, pwd); strlcat (p, pwd, len + 1);
(*init)(arg); (*init)(arg);
(*update)(arg, p, len); (*update)(arg, p, len);
(*final)(res, arg); (*final)(res, arg);