Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jamesmooneybodleian opened this issue Dec 13, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@jamesmooneybodleian
Copy link

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`

@richardlehane
Copy link
Owner

many thanks for reporting this @jamesmooneybodleian. I've received the sample file and will try to work out what is going wrong.

@richardlehane richardlehane self-assigned this Dec 13, 2023
@richardlehane
Copy link
Owner

Hi James, I believe this is fixed with the latest release (1.11.0) but please re-open if recurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants