bodgit / sevenzip

Golang library for dealing with 7-zip archives
https://godoc.org/github.com/bodgit/sevenzip
BSD 3-Clause "New" or "Revised" License
177 stars 15 forks source link

panic: runtime error: index out of range #181

Closed seedsnie closed 7 months ago

seedsnie commented 7 months ago

panic: runtime error: index out of range [104] with length 5

goroutine 74 [running]: panic({0x17e2ce0, 0xcaa3260}) c:/go/src/runtime/panic.go:987 +0x364 fp=0xdec1790 sp=0xdec1734 pc=0xcea404 runtime.goPanicIndex(0x68, 0x5) c:/go/src/runtime/panic.go:113 +0xa3 fp=0xdec17b0 sp=0xdec1790 pc=0xce8373 github.com/bodgit/sevenzip.readFilesInfo({0x2b3c1c40, 0xc91ded8}) C:/Users/Administrator/go/pkg/mod/github.com/bodgit/sevenzip@v1.3.0/types.go:707 +0xa66 fp=0xdec1870 sp=0xdec17b0 pc=0x111ed86 github.com/bodgit/sevenzip.readHeader({0x2b3c1c40, 0xc91ded8}) C:/Users/Administrator/go/pkg/mod/github.com/bodgit/sevenzip@v1.3.0/types.go:811 +0x108 fp=0xdec18ec sp=0xdec1870 pc=0x111eea8 github.com/bodgit/sevenzip.readEncodedHeader({0x2b3c1c40, 0xc91ded8}) C:/Users/Administrator/go/pkg/mod/github.com/bodgit/sevenzip@v1.3.0/types.go:849 +0xe8 fp=0xdec1914 sp=0xdec18ec pc=0x111f498 github.com/bodgit/sevenzip.(Reader).init(0xc0fe2a0, {0x19e1abc, 0xc717e90}, 0x38a5b) C:/Users/Administrator/go/pkg/mod/github.com/bodgit/sevenzip@v1.3.0/reader.go:356 +0xa42 fp=0xdec1ad0 sp=0xdec1914 pc=0x11153b2 github.com/bodgit/sevenzip.NewReaderWithPassword({0x19e1abc, 0xc717e90}, 0x38a5b, {0x0, 0x0}) C:/Users/Administrator/go/pkg/mod/github.com/bodgit/sevenzip@v1.3.0/reader.go:242 +0x8d fp=0xdec1af4 sp=0xdec1ad0 pc=0x111478d github.com/mholt/archiver/v4.SevenZip.Extract({0x0, {0x0, 0x0}}, {0x19e5ba8, 0xac341c0}, {0x19e1aa8, 0xc717e90}, {0x0, 0x0, 0x0}, ...) C:/Users/Administrator/go/pkg/mod/github.com/mholt/archiver/v4@v4.0.0-alpha.8/7z.go:76 +0x181 fp=0xdec1c44 sp=0xdec1af4 pc=0x1186111 github.com/mholt/archiver/v4.(SevenZip).Extract(0xac08240, {0x19e5ba8, 0xac341c0}, {0x19e1aa8, 0xc717e90}, {0x0, 0x0, 0x0}, 0xc2ebaf0)

:1 +0x85 fp=0xdec1c7c sp=0xdec1c44 pc=0x1190985 GServices/framework/system/fileapi.(*ArchiveReader).extractFiles(0x20f560c, {0x2b3c1aa8, 0xac08240}, 0xc717e90) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/framework/system/fileapi/archiver.go:131 +0xfa fp=0xdec1ccc sp=0xdec1c7c pc=0x11cff7a GServices/framework/system/fileapi.(*ArchiveReader).readArchiveFiles(0x20f560c, {0xca37a40, 0x64}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/framework/system/fileapi/archiver.go:91 +0x26a fp=0xdec1d68 sp=0xdec1ccc pc=0x11cfb2a GServices/framework/system/fileapi.(*ArchiveReader).ReadArchiveFiles(0x20f560c, {0xca37a40, 0x64}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/framework/system/fileapi/archiver.go:67 +0x109 fp=0xdec1d8c sp=0xdec1d68 pc=0x11cf879 GServices/Plugin/Edr/cache.(*ArchiveAssocCache).OnCreate(0x20f5600, {0xca37a40, 0x64}, {0xb7c6180, 0x20}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/cache/archiveassoc.go:74 +0x177 fp=0xdec1e94 sp=0xdec1d8c pc=0x1306dd7 GServices/Plugin/Edr/event/policy/crossplatform.(*ArchivePolicy).createArchive(0xae45280, {0x19e9e54, 0xd8db750}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/event/policy/crossplatform/archivepolicy.go:43 +0x173 fp=0xdec1ef4 sp=0xdec1e94 pc=0x155d0d3 GServices/Plugin/Edr/event/policy/crossplatform.(*ArchivePolicy).EventHandler(0xae45280, {0x19e9e54, 0xd8db750}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/event/policy/crossplatform/archivepolicy.go:23 +0x31 fp=0xdec1f04 sp=0xdec1ef4 pc=0x155cf11 GServices/Plugin/Edr/event.(*fillEvent).eventPolicyChain(0xaf48060, {0x19e9e54, 0xd8db750}, {0x1847ba7, 0x9}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/event/fill.go:158 +0x1a9 fp=0xdec1f7c sp=0xdec1f04 pc=0x157d5a9 GServices/Plugin/Edr/event.(*fillEvent).eventHandler(0xaf48060, {0x1847ba7, 0x9}) E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/event/fill.go:131 +0x204 fp=0xdec1fe0 sp=0xdec1f7c pc=0x157d264 GServices/Plugin/Edr/event.(*fillEvent).Start.func2() E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/event/fill.go:41 +0x39 fp=0xdec1ff0 sp=0xdec1fe0 pc=0x157c3a9 runtime.goexit() c:/go/src/runtime/asm_386.s:1326 +0x1 fp=0xdec1ff4 sp=0xdec1ff0 pc=0xd1da61 created by GServices/Plugin/Edr/event.(*fillEvent).Start E:/data/landun/workspace/TxiOAClient/client-cross-platform/master/GServices/Plugin/Edr/event/fill.go:41 +0xa3
bodgit commented 7 months ago

That backtrace shows an old version (v1.3.0) of this package. There's been 6-7 releases since including one that I think fixes this particular issue.

Please feel free to reopen if this is reproducible with the latest version. Attaching or linking to an example archive that triggers the issue is considered very helpful.

seedsnie commented 7 months ago

thanks for help,I'll try latest version