8000206: Uninitialized variable in PlainDatagramSocketImpl.c

Reviewed-by: dsamersoff, khazra, chegar
This commit is contained in:
John Zavgren 2012-10-19 11:43:59 +01:00 committed by Chris Hegarty
parent 1892ebf911
commit 3c2e0ae2ac

View File

@ -1318,10 +1318,8 @@ Java_java_net_PlainDatagramSocketImpl_socketSetOption(JNIEnv *env,
jobject value) {
int fd;
int level, optname, optlen;
union {
int i;
char c;
} optval;
int optval;
optlen = sizeof(int);
/*
* Check that socket hasn't been closed
@ -1381,8 +1379,7 @@ Java_java_net_PlainDatagramSocketImpl_socketSetOption(JNIEnv *env,
fid = (*env)->GetFieldID(env, cls, "value", "I");
CHECK_NULL(fid);
optval.i = (*env)->GetIntField(env, value, fid);
optlen = sizeof(optval.i);
optval = (*env)->GetIntField(env, value, fid);
break;
}
@ -1401,8 +1398,7 @@ Java_java_net_PlainDatagramSocketImpl_socketSetOption(JNIEnv *env,
on = (*env)->GetBooleanField(env, value, fid);
/* SO_REUSEADDR or SO_BROADCAST */
optval.i = (on ? 1 : 0);
optlen = sizeof(optval.i);
optval = (on ? 1 : 0);
break;
}