Initialize gss_get_name_attribute output buffers
authorGreg Hudson <ghudson@mit.edu>
Tue, 14 Feb 2012 18:26:50 +0000 (18:26 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 14 Feb 2012 18:26:50 +0000 (18:26 +0000)
GSS functions which accept gss_buffer_t output arguments should
initialize those buffers to empty on startup (see gss_wrap, for
instance).  Do so for gss_get_name_attribute in the mechglue.

ticket: 7089
target_version: 1.10.1
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25700 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/mechglue/g_get_name_attr.c

index d9363c118c7c2e4c955e1b58a61fe90f69b0976a..047d5d428fb03b69584abd5680bee462c17d211f 100644 (file)
@@ -55,6 +55,14 @@ gss_get_name_attribute(OM_uint32 *minor_status,
         *authenticated = 0;
     if (complete != NULL)
         *complete = 0;
+    if (value != GSS_C_NO_BUFFER) {
+        value->value = NULL;
+        value->length = 0;
+    }
+    if (display_value != GSS_C_NO_BUFFER) {
+        display_value->value = NULL;
+        display_value->length = 0;
+    }
 
     *minor_status = 0;