7009760: Possible stack corruption in Java_java_net_TwoStacksPlainSocketImpl_socketGetOption

SOCKET_ADDRESS -> SOCKETADDRESS

Reviewed-by: alanb
This commit is contained in:
Chris Hegarty 2011-01-07 21:02:58 +00:00
parent bbeb1fa936
commit c816ca10db

View File

@ -1032,21 +1032,20 @@ Java_java_net_TwoStacksPlainSocketImpl_socketGetOption(JNIEnv *env, jobject this
* SO_BINDADDR isn't a socket option
*/
if (opt == java_net_SocketOptions_SO_BINDADDR) {
SOCKET_ADDRESS him;
SOCKETADDRESS him;
int len;
int port;
jobject iaObj;
jclass iaCntrClass;
jfieldID iaFieldID;
len = sizeof(struct sockaddr_in);
len = sizeof(him);
if (fd == -1) {
/* must be an IPV6 only socket. Case where both sockets are != -1
* is handled in java
*/
fd = getFD1 (env, this);
len = sizeof(struct SOCKADDR_IN6);
}
if (getsockname(fd, (struct sockaddr *)&him, &len) < 0) {