From 1f27c47973bfae871da0d0f6cfd9ff2d28ec332a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Offenh=C3=A4user?= Date: Sat, 11 Feb 2023 20:59:06 +0100 Subject: [PATCH] LibPDF: Check for end of stream in Reader::matches_regular_character() The way this was set up before, this function would return "true" if the underlying stream had ended, which would cause us to try to read past the end in some edge cases. --- Userland/Libraries/LibPDF/Reader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibPDF/Reader.cpp b/Userland/Libraries/LibPDF/Reader.cpp index 58421812f9..7bef8d6b2d 100644 --- a/Userland/Libraries/LibPDF/Reader.cpp +++ b/Userland/Libraries/LibPDF/Reader.cpp @@ -34,7 +34,7 @@ bool Reader::matches_delimiter() const bool Reader::matches_regular_character() const { - return !matches_delimiter() && !matches_whitespace(); + return !done() && !matches_delimiter() && !matches_whitespace(); } bool Reader::consume_eol()