From 1594b9505c30ad72921a272d84349ac25a192ba8 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sat, 25 Oct 2025 20:14:02 +0200 Subject: [PATCH] Don't emit Parsing terminated on benign files by not reading past stream in skipComment() --- src/ifcparse/IfcParse.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ifcparse/IfcParse.cpp b/src/ifcparse/IfcParse.cpp index 2c53d759de..3a7c373a7d 100644 --- a/src/ifcparse/IfcParse.cpp +++ b/src/ifcparse/IfcParse.cpp @@ -126,6 +126,9 @@ size_t IfcSpfLexer::skipWhitespace() const { } size_t IfcSpfLexer::skipComment() const { + if (stream->eof()) { + return 0; + } char character = stream->peek(); if (character != '/') { return 0;