summaryrefslogtreecommitdiff
path: root/usr/src/lib/gss_mechs
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
committerDan McDonald <danmcd@joyent.com>2020-09-22 10:39:49 -0400
commit267e12a7d9bf6e5fcefb9cc00f46bfff0dc5226e (patch)
tree19a3941920d0039c35d53a5cbee189b5ca51995a /usr/src/lib/gss_mechs
parent517abc5c668925e6092495bf332233c3599980d2 (diff)
parente9faba760cdf80d7dfa110fe0830917ab94668c2 (diff)
downloadillumos-joyent-vpc.tar.gz
Merge branch 'master' into vpcvpc
Diffstat (limited to 'usr/src/lib/gss_mechs')
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/krb5/krb/bld_princ.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/bld_princ.c b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/bld_princ.c
index 505bde065e..a456aa04c8 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/bld_princ.c
+++ b/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/bld_princ.c
@@ -4,6 +4,8 @@
* Copyright 1991 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
+ * Copyright 2020 Nexenta by DDN, Inc. All rights reserved.
+ *
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
@@ -48,13 +50,14 @@ krb5_build_principal_va(krb5_context context, krb5_principal princ, unsigned int
if (data == 0)
return ENOMEM;
krb5_princ_set_realm_length(context, princ, rlen);
- tmpdata = malloc(rlen);
+ tmpdata = malloc(rlen + 1);
if (!tmpdata) {
free (data);
return ENOMEM;
}
krb5_princ_set_realm_data(context, princ, tmpdata);
memcpy(tmpdata, realm, rlen);
+ tmpdata[rlen] = '\0';
/* process rest of components */