From: Ezra Peisach Date: Mon, 6 Oct 1997 20:25:33 +0000 (+0000) Subject: * set_realm.c (krb5_set_principal_realm): Allocate extra byte for nul in X-Git-Tag: krb5-1.1-beta1~1017 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=361c92edbae3ddaf232ed14fa6233e45e0512fc1;p=krb5.git * set_realm.c (krb5_set_principal_realm): Allocate extra byte for nul in strcpy git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10208 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 466225883..cdc7d0772 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +Mon Oct 6 12:07:19 1997 Ezra Peisach + + * set_realm.c (krb5_set_principal_realm): Allocate extra byte for + \0 after realm. + Mon Sep 1 21:38:16 1997 Tom Yu * rd_cred.c (krb5_rd_cred_basic): Fix swapped args to memset. diff --git a/src/lib/krb5/krb/set_realm.c b/src/lib/krb5/krb/set_realm.c index 2611da896..a422c00cc 100644 --- a/src/lib/krb5/krb/set_realm.c +++ b/src/lib/krb5/krb/set_realm.c @@ -36,7 +36,7 @@ krb5_set_principal_realm(context, principal, realm) return -EINVAL; length = strlen(realm); - newrealm = malloc(length); + newrealm = malloc(length+1); /* Include room for the null */ if (!newrealm) return -ENOMEM; strcpy(newrealm, realm);