Skip to content

Commit

Permalink
Merge pull request #10185 from JasonFengJ9/jnicheck
Browse files Browse the repository at this point in the history
Add NULL check for JNIC_JMETHODID & JNIC_JFIELDID
  • Loading branch information
gacholio committed Jul 17, 2020
2 parents 8afb12c + 064a6c8 commit fe03e4a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/jnichk/jnicheck.c
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2019 IBM Corp. and others
* Copyright (c) 1991, 2020 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -587,12 +587,18 @@ jniCheckArgs(const char *function, int exceptionSafe, int criticalSafe, J9JniChe

case JNIC_JMETHODID:
aJmethodID = va_arg(va, jmethodID);
if (NULL == aJmethodID) {
jniCheckFatalErrorNLS(env, J9NLS_JNICHK_NULL_ARGUMENT, function, argNum);
}
if (trace) {
jniTraceMethodID(env, aJmethodID);
}
break;
case JNIC_JFIELDID:
aJfieldID = va_arg(va, jfieldID);
if (NULL == aJfieldID) {
jniCheckFatalErrorNLS(env, J9NLS_JNICHK_NULL_ARGUMENT, function, argNum);
}
if (trace) {
jniTraceFieldID(env, aJfieldID);
}
Expand Down

0 comments on commit fe03e4a

Please sign in to comment.