From: Scott Kitterman <scott@kitterman.com>
Date: Mon, 15 Jan 2024 11:34:11 -0500
Subject: Prevent infinite loop when no character follows after a comment
https://security-tracker.debian.org/tracker/CVE-2023-36464
---
 PyPDF2/generic/_data_structures.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: pypdf/PyPDF2/generic/_data_structures.py
===================================================================
--- pypdf.orig/PyPDF2/generic/_data_structures.py
+++ pypdf/PyPDF2/generic/_data_structures.py
@@ -733,7 +733,7 @@ class ContentStream(DecodedStreamObject)
                 # encountering a comment -- but read_object assumes that
                 # following the comment must be the object we're trying to
                 # read.  In this case, it could be an operator instead.
-                while peek not in (b"\r", b"\n"):
+                while peek not in (b"\r", b"\n", b""):
                     peek = stream.read(1)
             else:
                 operands.append(read_object(stream, None, self.forced_encoding))
