From 52050796e783ddbb8daa468337e94240f665cbf3 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 17 Feb 2014 11:59:28 +0100 Subject: [PATCH] [#2238] Fix bug which caused a SIGSEGV when calling remoteAddress() or localAddress() --- .../src/main/c/io_netty_channel_epoll_Native.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c b/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c index c52ad62b48..05b5edb5f4 100644 --- a/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c +++ b/transport-native-epoll/src/main/c/io_netty_channel_epoll_Native.c @@ -132,7 +132,8 @@ jobject createInetSocketAddress(JNIEnv * env, struct sockaddr_storage addr) { port = ntohs(s->sin6_port); 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; }