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>
--- 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);