summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/roken/strlcat.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2002-08-30 21:23:27 +0000
committernectar <nectar@FreeBSD.org>2002-08-30 21:23:27 +0000
commita77dba08ca7d8ad2f2dcd653974ac66df78cfa49 (patch)
tree6015f89700252fb05eb8fa267c46dba41913e9d8 /crypto/heimdal/lib/roken/strlcat.c
parent69a91bec14ec3ad49d1c8a82c40a796755f9e4a3 (diff)
downloadFreeBSD-src-a77dba08ca7d8ad2f2dcd653974ac66df78cfa49.zip
FreeBSD-src-a77dba08ca7d8ad2f2dcd653974ac66df78cfa49.tar.gz
Import of Heimdal Kerberos from KTH repository circa 2002/08/29.
Diffstat (limited to 'crypto/heimdal/lib/roken/strlcat.c')
-rw-r--r--crypto/heimdal/lib/roken/strlcat.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/heimdal/lib/roken/strlcat.c b/crypto/heimdal/lib/roken/strlcat.c
index d3c8baa..1366e88 100644
--- a/crypto/heimdal/lib/roken/strlcat.c
+++ b/crypto/heimdal/lib/roken/strlcat.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan
+ * Copyright (c) 1995-2002 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -36,7 +36,7 @@
#endif
#include "roken.h"
-RCSID("$Id: strlcat.c,v 1.5 1999/12/02 16:58:53 joda Exp $");
+RCSID("$Id: strlcat.c,v 1.6 2002/08/20 09:46:20 joda Exp $");
#ifndef HAVE_STRLCAT
@@ -45,6 +45,12 @@ strlcat (char *dst, const char *src, size_t dst_sz)
{
size_t len = strlen(dst);
+ if (dst_sz < len)
+ /* the total size of dst is less than the string it contains;
+ this could be considered bad input, but we might as well
+ handle it */
+ return len + strlen(src);
+
return len + strlcpy (dst + len, src, dst_sz - len);
}
#endif
OpenPOWER on IntegriCloud