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

ExcelReaderFactory.CreateBinaryReader can throw unexpected exceptions #383

Closed
Metalnem opened this issue Dec 25, 2018 · 0 comments
Closed

Comments

@Metalnem
Copy link

In most cases, ExcelReaderFactory.CreateBinaryReader throws an ExcelReaderException when encountering an invalid input. However, it can throw several other exception types when opening files from the attached archive. These are:

  • ArgumentOutOfRangeException
  • FormatException
  • InvalidOperationException

You can run the following code to reproduce this (path should contain the path to one of the extracted files):

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

using (var file = File.OpenRead(path))
{
  ExcelReaderFactory.CreateBinaryReader(file);
}

Found via SharpFuzz.

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