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

Issue reading MulBlank record #24

Closed
kleeon opened this issue Sep 26, 2022 · 0 comments
Closed

Issue reading MulBlank record #24

kleeon opened this issue Sep 26, 2022 · 0 comments

Comments

@kleeon
Copy link
Contributor

kleeon commented Sep 26, 2022

OpenFile panics for some documents with this message:

panic: runtime error: slice bounds out of range [:960] with capacity 958

goroutine 1 [running]:
github.com/shakinm/xlsReader/xls/record.(*MulBlank).Read(0xc000076ce0, {0xc000a92c8d, 0xc00705eac8?, 0x4?})
C:/Users/####/go/pkg/mod/github.com/shakinm/xls!reader@v0.9.11/xls/record/mulblank.go:61 +0x1fc
github.com/shakinm/xlsReader/xls.(*Sheet).read(0xc0000b81b0, {0xc000820000, 0x27304b?, 0x27304b})
C:/Users/####/go/pkg/mod/github.com/shakinm/xls!reader@v0.9.11/xls/sheet.go:194 +0xf9e
github.com/shakinm/xlsReader/xls.readStream({0x10f28c8, 0xc0000704b0}, 0x27304b)
C:/Users/####/go/pkg/mod/github.com/shakinm/xls!reader@v0.9.11/xls/xls.go:99 +0x1a5
github.com/shakinm/xlsReader/xls.openCfb({{{0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1}, {0x0, 0x0, ...}, ...}, ...})
C:/Users/####/go/pkg/mod/github.com/shakinm/xls!reader@v0.9.11/xls/xls.go:65 +0x1df
github.com/shakinm/xlsReader/xls.OpenFile({0x10ce961?, 0xc000036000?})
C:/Users/####/go/pkg/mod/github.com/shakinm/xls!reader@v0.9.11/xls/xls.go:20 +0x185
main.main()
C:/Users/####/Desktop/projects/excel_xml/main.go:98 +0x33
exit status 2

I tracked down the issue to this line:

sPoint := 4 + (i * 6)

According to Microsoft docs, IXFCell structure is 2 bytes long, not 6. So the indexing seems to be off

kleeon added a commit to kleeon/xlsReader that referenced this issue Sep 26, 2022
shakinm added a commit that referenced this issue Sep 27, 2022
@kleeon kleeon closed this as completed Sep 27, 2022
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

1 participant