Limit readline()

This commit is contained in:
pixeebot[bot] 2024-04-16 04:51:38 +00:00 committed by GitHub
parent 3ff9520114
commit 7879dd3aac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,7 +30,7 @@ class ParseZeekLogs(object):
meta = loads(dumps(meta).replace("'", '"'))
# Read the header option lines
l = self.fd.readline().strip()
l = self.fd.readline(5_000_000).strip()
while l.strip().startswith("#"):
# Parse the options out
if l.startswith("#separator"):
@ -44,7 +44,7 @@ class ParseZeekLogs(object):
self.options[key] = value
# Read the next line
l = self.fd.readline().strip()
l = self.fd.readline(5_000_000).strip()
self.firstLine = l