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 bug #1

Open
Kleissner opened this issue Aug 27, 2019 · 0 comments
Open

Slice bounds out of range bug #1

Kleissner opened this issue Aug 27, 2019 · 0 comments

Comments

@Kleissner
Copy link

Kleissner commented Aug 27, 2019

The code uses d.Bsize without checking if it's within the range of the slice d.NameBts. A specially crafted ole2 file (Excel sheet) can crash the application by setting a a high number for d.Bsize.

ole2/dir.go

Lines 32 to 35 in d694296

func (d *File) Name() string {
runes := utf16.Decode(d.NameBts[:d.Bsize/2-1])
return string(runes)
}

The fix is to check the ranges first.

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