Skip to content

Commit

Permalink
Merge pull request #2520 from gacholio/callback
Browse files Browse the repository at this point in the history
Ignore unknown JVMTI callbacks
  • Loading branch information
pshipton authored Jul 31, 2018
2 parents 849110a + 0b31810 commit 24e5363
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/jvmti/jvmtiEventManagement.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jvmtiSetEventCallbacks(jvmtiEnv* env,
JVMTI_ERROR(JVMTI_ERROR_ILLEGAL_ARGUMENT);
}

/* Assume jvmtiEventCallbacks always reflects the largest possible callback table (most current version) */
/* Ignore any callbacks which exceed the size of the table of the latest known version in this VM */

if (size_of_callbacks > sizeof(jvmtiEventCallbacks)) {
JVMTI_ERROR(JVMTI_ERROR_ILLEGAL_ARGUMENT);
size_of_callbacks = sizeof(jvmtiEventCallbacks);
}

size_of_callbacks /= sizeof(void *);
Expand Down

0 comments on commit 24e5363

Please sign in to comment.