From 361c92edbae3ddaf232ed14fa6233e45e0512fc1 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 6 Oct 1997 20:25:33 +0000 Subject: * 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 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/set_realm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 4662258837..cdc7d07728 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 2611da8967..a422c00cce 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); -- cgit