svn rev #25342: trunk/src/lib/gssapi/generic/

hartmans@MIT.EDU hartmans at MIT.EDU
Fri Oct 14 11:07:01 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25342
Commit By: hartmans
Log Message:
Fix gssapi_strdup


Changed Files:
U   trunk/src/lib/gssapi/generic/gssapi_alloc.h
Modified: trunk/src/lib/gssapi/generic/gssapi_alloc.h
===================================================================
--- trunk/src/lib/gssapi/generic/gssapi_alloc.h	2011-10-14 14:46:57 UTC (rev 25341)
+++ trunk/src/lib/gssapi/generic/gssapi_alloc.h	2011-10-14 15:07:01 UTC (rev 25342)
@@ -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 @@
 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;
 }




More information about the cvs-krb5 mailing list