This repository was archived by the owner on Jun 30, 2023. It is now read-only.
Commit 3648656
jar: support Go 1.19 archive/zip
In Go 1.19 the standard library's archive/zip package will
automatically and silently handle a prefixed zip file.
The log4jscanner package expects to handle the offset itself.
To let log4jscanner work with both Go 1.18 and 1.19,
change it to read the offset first, before using the archive/zip
package.
Tested by running tests with both Go 1.18 and Go tip.
Without this change, Go tip fails with
--- FAIL: TestAutoMitigateExecutable (0.00s)
--- FAIL: TestAutoMitigateExecutable/helloworld-executable (0.00s)
rewrite_test.go:247: expected offset for executable testdata/helloworld-executable: got=0
--- FAIL: TestAutoMitigateExecutable/vuln-class-executable (0.00s)
rewrite_test.go:247: expected offset for executable testdata/vuln-class-executable: got=0
FAIL
FAIL github.com/google/log4jscanner/jar 34.541s1 parent 7f8e802 commit 3648656
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | 214 | | |
219 | 215 | | |
220 | 216 | | |
221 | 217 | | |
222 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
223 | 222 | | |
224 | 223 | | |
225 | 224 | | |
| |||
0 commit comments