summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2011-10-14 15:07:01 +0000
committerSam Hartman <hartmans@mit.edu>2011-10-14 15:07:01 +0000
commitf85af5c81fb43539cc9f1a0a50932c4013ee6f25 (patch)
tree6c540ea7ccef919f6b0c5960d670592e69e5153e /src/lib
parent061933984e3fe8ee630d9daed7cbcc72432005d5 (diff)
downloadkrb5-f85af5c81fb43539cc9f1a0a50932c4013ee6f25.tar.gz
krb5-f85af5c81fb43539cc9f1a0a50932c4013ee6f25.tar.xz
krb5-f85af5c81fb43539cc9f1a0a50932c4013ee6f25.zip
Fix gssapi_strdup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25342 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/gssapi/generic/gssapi_alloc.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/gssapi/generic/gssapi_alloc.h b/src/lib/gssapi/generic/gssapi_alloc.h
index a192124666..a28533ed4f 100644
--- a/src/lib/gssapi/generic/gssapi_alloc.h
+++ b/src/lib/gssapi/generic/gssapi_alloc.h
@@ -10,11 +10,6 @@
#include "winbase.h"
#endif
#include <string.h>
-/*
- * Note that we'll need to do something else if we decide to install
- * this header for mechanisms.
- */
-#include <k5-platform.h>
static inline void
gssalloc_free(void * value)
@@ -61,10 +56,11 @@ gssalloc_realloc(void *value, size_t size)
static inline char *
gssalloc_strdup(const char *str)
{
- int size = strlen(str)+1;
+ size_t size = strlen(str)+1;
char *copy = gssalloc_malloc(size);
if (copy) {
- strlcpy(copy, str, size);
+ memcpy(copy, str, size);
+ copy[size-1] = '\0';
}
return copy;
}