Skip to content

Fix crash on too big files #94

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

molsonkiko
Copy link
Contributor

@molsonkiko molsonkiko commented Oct 2, 2024

This would address #93.

Previously CSVLint assumed that all files had fewer than int.MaxValue (2147483647) bytes, and any files longer than that would simply cause the plugin to crash.

This is OK (but far from ideal) if Notepad++ catches the crash, but if not, such a crash could cause Notepad++ to fail unexpectedly.

This commit implements a more graceful handling of too-large files, where the user is initially notified if they try to run a plugin command on a too-large file, and they can opt out of such notifications.

Whether or not the user is notified, all plugin commands will do nothing after they detect that the file is too large.

Previously CSVLint assumed that all files had length less than
    int.MaxValue (2147483647), and any files longer than that would simply cause the plugin to crash.
    This is OK if Notepad++ catches the crash, but if not, such a crash could cause Notepad++ to fail unexpectedly.
This commit implements a more graceful handling of too-large files, where the user is initially
    notified if they try to run a plugin command on a too-large file, and they can opt out of such notifications.
    Whether or not the user is notified, all plugin commands will do nothing after they detect that the file is too large.
Also reduce risk of null dereference on return value from Main.GetCurrentCsvDef,
rename that function to Main.TryGetCurrentCsvDef
it was auto-inserted by Visual Studio in an earlier commit
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

Successfully merging this pull request may close these issues.

1 participant