[#2238] Fix bug which caused a SIGSEGV when calling remoteAddress() or localAddress()
This commit is contained in:
parent
e0669522a3
commit
52050796e7
@ -132,7 +132,8 @@ jobject createInetSocketAddress(JNIEnv * env, struct sockaddr_storage addr) {
|
|||||||
port = ntohs(s->sin6_port);
|
port = ntohs(s->sin6_port);
|
||||||
inet_ntop(AF_INET6, &s->sin6_addr, ipstr, sizeof ipstr);
|
inet_ntop(AF_INET6, &s->sin6_addr, ipstr, sizeof ipstr);
|
||||||
}
|
}
|
||||||
jobject socketAddr = (*env)->NewObject(env, inetSocketAddressClass, inetSocketAddrMethodId, ipstr, port);
|
jstring ipString = (*env)->NewStringUTF(env, ipstr);
|
||||||
|
jobject socketAddr = (*env)->NewObject(env, inetSocketAddressClass, inetSocketAddrMethodId, ipString, port);
|
||||||
return socketAddr;
|
return socketAddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user