Commit 2321a9b
committed
Fix array index out of bounds in getAgentCaller method
The getAgentCaller method in Analyzer.java had a bug where it could
access frames.get(i + 1) when i = frames.size() - 1, causing an
IndexOutOfBoundsException.
Fixed by:
- Changing loop condition from i >= 0 to i >= 1
- Changing access from frames.get(i + 1) to frames.get(i - 1)
This ensures we never access beyond array bounds while maintaining
the correct logic to find the caller of agent methods.1 parent f87d454 commit 2321a9b
File tree
1 file changed
+2
-2
lines changed- benchmark-jfr-analyzer/src/main/java/io/opentelemetry/javaagent/benchmark/jfr
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments