windows-nim-afscred-referrals-two-20080105
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 5 Jan 2008 18:55:55 +0000 (18:55 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 5 Jan 2008 18:55:55 +0000 (18:55 +0000)
LICENSE MIT

compatibility with Visual Studio 2005/2008

src/WINNT/netidmgr_plugin/afsfuncs.c

index b278280..66eab2a 100644 (file)
@@ -715,8 +715,7 @@ copy_realm_of_ticket(krb5_context context, char * dest, size_t destlen, krb5_cre
         if (len > destlen - 1)
             len = destlen - 1;
 
-        strncpy(dest, krb5_princ_realm(context, ticket->server)->data, len);
-        dest[len] = 0;
+        StringCbCopyA(dest, len, krb5_princ_realm(context, ticket->server)->data);
 
         pkrb5_free_ticket(context, ticket);
     }