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

Slice bounds out of range #18

Open
JurisU opened this issue Mar 11, 2021 · 1 comment
Open

Slice bounds out of range #18

JurisU opened this issue Mar 11, 2021 · 1 comment

Comments

@JurisU
Copy link

JurisU commented Mar 11, 2021

Version: 0.9.10
Stack trace:

panic: runtime error: slice bounds out of range [:17861] with capacity 3993

goroutine 1 [running]:
github.com/shakinm/xlsReader/xls.(*Workbook).read(0xc000110240, 0xc00012b000, 0xf99, 0xf99, 0xf99, 0x0)
	/Users/juris/Work/golang/pkg/mod/github.com/shakinm/xls!reader@v0.9.10/xls/workbook.go:87 +0x159f
github.com/shakinm/xlsReader/xls.readStream(0x1147ae8, 0xc00007a360, 0xc000000f99, 0x1147ae8, 0xc00007a360, 0x0, 0x0, 0x30, 0x28, 0x110b340, ...)
	/Users/juris/Work/golang/pkg/mod/github.com/shakinm/xls!reader@v0.9.10/xls/xls.go:84 +0xc8
github.com/shakinm/xlsReader/xls.openCfb(0xe11ab1a1e011cfd0, 0x0, 0x0, 0x9fffe0003003e, 0x6, 0x100000000, 0x100000000, 0x1100001000, 0xffffffff00000001, 0x1200000000, ...)
	/Users/juris/Work/golang/pkg/mod/github.com/shakinm/xls!reader@v0.9.10/xls/xls.go:62 +0x22c
github.com/shakinm/xlsReader/xls.OpenFile(0x7ffeefbff919, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/juris/Work/golang/pkg/mod/github.com/shakinm/xls!reader@v0.9.10/xls/xls.go:17 +0x17c
main.main()
	main2.go:28 +0x8f
exit status 2

Died on reading file workbook, err := xls.OpenFile(*filename)

Can read the same file with PHP package phpoffice/phpspreadsheet
PHP found 0x31 4 symbols, this package find only 3 and next is 0x6d, but should be 0x31

Input file:
Untitled 5.xls.zip

kleeon added a commit to kleeon/xlsReader that referenced this issue Feb 21, 2023
@kleeon
Copy link
Contributor

kleeon commented Feb 21, 2023

This is happening due to improper handling of mini-FAT container streams. Before reading mini-FAT stream, container stream has to be read first (Section 6.1). I fixed it in my fork.

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

No branches or pull requests

2 participants