8194630: Uninitialized initiator_address in native GSS
authorvaleriep
Thu, 24 May 2018 00:37:29 +0000
changeset 50244 317a8688db78
parent 50243 4fac3c99487d
child 50245 5e7174bf1259
8194630: Uninitialized initiator_address in native GSS Summary: Zeroized the initiator/acceptor_address in gss_channel_bindings_t Reviewed-by: valeriep Contributed-by: Jan Kalina <jkalina@redhat.com>
src/java.security.jgss/share/native/libj2gss/GSSLibStub.c
--- a/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Wed May 23 17:09:49 2018 -0700
+++ b/src/java.security.jgss/share/native/libj2gss/GSSLibStub.c	Thu May 24 00:37:29 2018 +0000
@@ -192,6 +192,10 @@
   cb->initiator_addrtype = GSS_C_AF_NULLADDR;
   cb->acceptor_addrtype = GSS_C_AF_NULLADDR;
 
+  // addresses needs to be initialized to empty
+  memset(&cb->initiator_address, 0, sizeof(cb->initiator_address));
+  memset(&cb->acceptor_address, 0, sizeof(cb->acceptor_address));
+
   /* set up initiator address */
   jinetAddr = (*env)->CallObjectMethod(env, jcb,
       MID_ChannelBinding_getInitiatorAddr);