Skip to content

Slice bounds out of range bug #1

Open
@Kleissner

Description

@Kleissner

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Kleissner

        Issue actions

          Slice bounds out of range bug · Issue #1 · extrame/ole2