Skip to content

Commit

Permalink
Merge pull request #775 from criblio/bug/737-check-return-code
Browse files Browse the repository at this point in the history
Resolve segfault in Java
  • Loading branch information
jrcheli authored Feb 10, 2022
2 parents 7872543 + b3bbf06 commit 82ef875
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/javaagent.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ doJavaProtocol(JNIEnv *jni, jobject session, jbyteArray buf, jint offset, jint l
{
jint hash = (*jni)->CallIntMethod(jni, session, g_java.mid_Object_hashCode);
jbyte *byteBuf = (*jni)->GetPrimitiveArrayCritical(jni, buf, 0);
if (!byteBuf) return;
doProtocol((uint64_t)hash, fd, &byteBuf[offset], (size_t)(len - offset), src, BUF);
//scopeLogHexError(&byteBuf[offset], (len - offset), "doJavaProtocol");
(*jni)->ReleasePrimitiveArrayCritical(jni, buf, byteBuf, 0);
Expand Down

0 comments on commit 82ef875

Please sign in to comment.