Skip to content

Commit

Permalink
Disregard "Auto Newline" user setting and always assume auto newline …
Browse files Browse the repository at this point in the history
…in FileReader

This may not be the proper place to fix this but it works nicely at least as a temporary measure. The alternative is a potential DoS when trying to open large files as discussed in CobaltFusion#352.

Now FileReader always splits on newlines regardless of what the user selected for "Auto Newline" option from the menu. Fixes CobaltFusion#352.
  • Loading branch information
Ishmaeel committed Jul 31, 2021
1 parent ca8a8e1 commit 057a12e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DebugView++Lib/FileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ void FileReader::Abort()
}
}

bool FileReader::GetAutoNewLine() const
{
return true;
}

void FileReader::PollThread()
{
// FILE_NOTIFY_CHANGE_SIZE is broken on windows vista and above in that it does not
Expand Down
1 change: 1 addition & 0 deletions include/DebugView++Lib/FileReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class FileReader : public LogSource
HANDLE GetHandle() const override;
void Notify() override;
void PreProcess(Line& line) const override;
virtual bool GetAutoNewLine() const override;

protected:
virtual void AddLine(const std::string& line);
Expand Down

0 comments on commit 057a12e

Please sign in to comment.