Le028 — Stray NUL bytes / DOS `\r\n` line endings inside the file

§12.1a encoding/strings (sub-class: control characters / framing)

P1 — silent data loss

silent-loss encoding

Sources

Description

Files transmitted through Windows-aware tools accumulate stray NUL bytes or `CR LF` line terminators. Naive scanners that only handle bare `\n` mis-count line numbers or misread tokens.

Reproducer recipe

file with `CR LF` line endings throughout; or stray `\x00` bytes injected between tokens.

Expected kernel behavior

ignore CR (treat as whitespace); skip stray NULs with a warning; emit accurate line numbers under either convention.

Notes

Cross-oracle: pure-Python Part-21 validator rejects (reject(E_NO_MAGIC)); OCCT silently accepts (load is `empty`). OCC auto-heals a spec-level violation. Synonyms: "NUL byte in STEP file", "CRLF line endings in STEP", "DOS line breaks in Unix parser", "stray null bytes in STEP", "Windows CRLF confuses line numbering".

Expected validation

occt=empty/empty gmsh=empty ifc=reject

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;

2/* Le028: Stray NUL bytes and DOS CR LF line endings inside STEP file; ISO 10303-21 §6.1: line terminators are implementation-defined but most parsers assume bare LF (0x0A) only; OCCT lex grammar (StepFile/step.lex:118-119 e3i fix) handles CR; naive scanners that only handle bare LF mis-count lines on CR LF files; stray NUL bytes (0x00) between tokens cause lexer abort or token misread; cross-oracle: pure-Python Part-21 validator rejects with E_NO_MAGIC; OCCT silently heals CR LF but may reject NUL; file uses CR LF throughout AND contains stray NUL between tokens; GEOMETRIC_CURVE_SET IS model entity — OCC yields empty */

3HEADER;

4FILE_DESCRIPTION(('Le028'),'2;1');

5FILE_NAME('Le028.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');

6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));

7ENDSEC;

8DATA;

9#1=CARTESIAN_POINT('',(0.0,0.0,0.0));

10#2=GEOMETRIC_CURVE_SET('',(#1));

11#8997=PERSON('namewith-nul','nul-byte-demo','');

12

13ENDSEC;

14END-ISO-10303-21;