FollowReferences function has unreachable code. The null check was incorrectly 
applied to the klass variable inside a block where klass is already guaranteed 
to be non-null. Because of this, the check was always false, and the extracted 
internal Klass* pointer (k) was left unchecked, which could lead to a null 
pointer dereference.

Fix the typo by changing klass to k in the null check.

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8389941: JvmtiEnv::FollowReferences has unreachable code in jvmtiEnv.cpp

Changes: https://git.openjdk.org/jdk/pull/32253/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32253&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8389941
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/32253.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/32253/head:pull/32253

PR: https://git.openjdk.org/jdk/pull/32253

Reply via email to