提交 ba0e2b5f 编写于 作者: M msheppar

8046901: Check jdk/src/solaris/native/sun/nio for Parfait flagged uninitialized memory

Reviewed-by: rriggs, alanb
上级 5b7640a3
......@@ -201,7 +201,7 @@ Java_sun_nio_ch_DatagramChannelImpl_receive0(JNIEnv *env, jobject this,
}
if (senderAddr == NULL) {
jobject isa = NULL;
int port;
int port = 0;
jobject ia = NET_SockaddrToInetAddress(env, (struct sockaddr *)&sa, &port);
if (ia != NULL) {
isa = (*env)->NewObject(env, isa_class, isa_ctorID, ia, port);
......
......@@ -84,7 +84,7 @@ Java_sun_nio_ch_ServerSocketChannelImpl_accept0(JNIEnv *env, jobject this,
int alloc_len;
jobject remote_ia = 0;
jobject isa;
jint remote_port;
jint remote_port = 0;
NET_AllocSockaddr(&sa, &alloc_len);
if (sa == NULL) {
......
......@@ -431,7 +431,7 @@ jobjectArray getRemoteAddresses
paddr = addr_buf;
for (i=0; i<addrCount; i++) {
jobject ia, isa = NULL;
int port;
int port = 0;
sap = (struct sockaddr*)addr_buf;
ia = NET_SockaddrToInetAddress(env, sap, &port);
if (ia != NULL)
......@@ -543,6 +543,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_sctp_SctpNet_getIntOption0
void *arg;
int arglen;
memset((char *) &linger, 0, sizeof(linger));
if (mapSocketOption(opt, &klevel, &kopt) < 0) {
JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
"Unsupported socket option");
......@@ -600,7 +601,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0
(JNIEnv *env, jclass klass, jint fd, jint assocId, jobject iaObj, jint port) {
struct sctp_setprim prim;
struct sockaddr* sap = (struct sockaddr*)&prim.ssp_addr;
int sap_len;
int sap_len = sizeof(sap);
if (NET_InetAddressToSockaddr(env, iaObj, port, sap,
&sap_len, JNI_TRUE) != 0) {
......@@ -625,7 +626,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0
jobject iaObj, jint port, jboolean preferIPv6) {
struct sctp_setpeerprim prim;
struct sockaddr* sap = (struct sockaddr*)&prim.sspp_addr;
int sap_len;
int sap_len = sizeof(sap);
if (NET_InetAddressToSockaddr(env, iaObj, port, sap,
&sap_len, preferIPv6) != 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册