8074368: ThreadMXBean.getThreadInfo() corrupts memory when called with empty array for thread ids

Reviewed-by: mchung
This commit is contained in:
Jaroslav Bachorik 2015-04-03 15:40:35 +02:00
parent 89256b01cb
commit ed433c58a0

View File

@ -1109,6 +1109,8 @@ static void do_thread_dump(ThreadDumpResult* dump_result,
bool with_locked_monitors,
bool with_locked_synchronizers,
TRAPS) {
// no need to actually perform thread dump if no TIDs are specified
if (num_threads == 0) return;
// First get an array of threadObj handles.
// A JavaThread may terminate before we get the stack trace.