Fix JVM segfault during JNI call. Part of [#2647]
Motivation: Currently when Native.writev(...) is used it is possible to see a JVM segfault because the offset is updated to early. Modification: Only update the offset once it is safe to do so. Result: No more segfault
This commit is contained in:
parent
fb22d34925
commit
62bbd4220a
@ -761,8 +761,6 @@ JNIEXPORT jlong JNICALL Java_io_netty_channel_epoll_Native_writev(JNIEnv * env,
|
||||
}
|
||||
|
||||
w += res;
|
||||
offset += loop;
|
||||
length -= loop;
|
||||
|
||||
// update the position of the written buffers
|
||||
int written = res;
|
||||
@ -791,6 +789,8 @@ JNIEXPORT jlong JNICALL Java_io_netty_channel_epoll_Native_writev(JNIEnv * env,
|
||||
}
|
||||
|
||||
}
|
||||
offset += loop;
|
||||
length -= loop;
|
||||
}
|
||||
return w;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user