Skip to content

version 1.10.1 - panic: runtime error when reading corrupted file #238

Description

@jamesmooneybodleian

Since upgrading to siegfried version 1.10.1 I'm seeing this odd panic error when attempting to read a file. older versions of siegfried appeared to reading the file without issue. The file in question is known to be corrupt, but wanted to highlight the problem of the panic when attempting to read the file.

As the file (13mb) is a real archive, but not sensitive, I would prefer to send it privately if possible?

System details:
siegfried 1.10.1
identifiers:

  • pronom: DROID_SignatureFile_V112.xml; container-signature-20230510.xml

Error message when attempting to read file with siegfried:

`panic: runtime error: slice bounds out of range [-9:]

goroutine 9 [running]:
github.com/richardlehane/siegfried/internal/siegreader.(*file).Slice(0xc000062c00?, 0xc000369180?, 0x0?)
/tmp/siegfried/internal/siegreader/file.go:76 +0x145
github.com/richardlehane/siegfried/internal/siegreader.(*Reader).ReadAt(0xc000418780, {0xc000369180, 0x1e, 0x0?}, 0x0?)
/tmp/siegfried/internal/siegreader/reader.go:115 +0xa7
archive/zip.(*File).findBodyOffset(0xc00013a790)
/usr/lib/golang/src/archive/zip/reader.go:340 +0x5b
archive/zip.(*File).Open(0xc00013a790)
/usr/lib/golang/src/archive/zip/reader.go:218 +0x27
github.com/richardlehane/siegfried/internal/containermatcher.(*zipReader).SetSource(0xc000407720, 0x417a53?)
/tmp/siegfried/internal/containermatcher/zip.go:45 +0x3c
github.com/richardlehane/siegfried/internal/containermatcher.(*cTest).identify(0xc00003b080, 0xc00017b570, 0xc00006cf20, {0x84ff98, 0xc000407720}, {0xc00037e000, 0x13})
/tmp/siegfried/internal/containermatcher/identify.go:165 +0x2ee
github.com/richardlehane/siegfried/internal/containermatcher.(*ContainerMatcher).identify(0xc00017b570, {0x7ffd3b17c547, 0x42}, {0x84ff98, 0xc000407720}, 0x0?, {0x0, 0x0, 0x0})
/tmp/siegfried/internal/containermatcher/identify.go:145 +0x365
created by github.com/richardlehane/siegfried/internal/containermatcher.Matcher.Identify in goroutine 1
/tmp/siegfried/internal/containermatcher/identify.go:43 +0x2d1`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions