Commit 90dc3cf
authored
stage2/ml9: Fix crash with SinytraConnector
The "Sinytra Connector" mod uses a custom `SecureJar` implementation,
which prior to this commit resulted in us doing an out of bounds memory
read (returning what looks like a String, resulting in a class cast
exception) because we were using the same unsafe getter that we were
using for ML's `Jar` implementation.
This commit fixes the issue by using a separate getter for each
implementation class.
This change alone is sufficient to fix the issue because we'll then get
an explicit `NoSuchFieldException`, which we catch. However, to avoid
unnessecary log spam, this commit additionally special cases the dummy
class to silently return `null`. It also changes our `getVersion` method
to still try the fallback paths (which do work!) instead of returning
early on `null` since that is now a legitimate case.
GitHub: #251 parent 3ba3bb3 commit 90dc3cf
File tree
1 file changed
+21
-5
lines changed- stage2/modlauncher9/src/main/java/gg/essential/loader/stage2/util
1 file changed
+21
-5
lines changedLines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | | - | |
58 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| |||
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
125 | 140 | | |
126 | | - | |
| 141 | + | |
127 | 142 | | |
128 | 143 | | |
| 144 | + | |
129 | 145 | | |
130 | 146 | | |
131 | 147 | | |
| |||
0 commit comments