|
FhSim
3.1.0
Marine systems simulation
|
| ID | 0108 |
| Class | KNOWN-LIMITATION |
| Severity | 2 |
| Status | blocked |
Models: —
Decision needed: may a licence file be refused when its size is not 2*kHeaderBytes + n*kLineLength? Older files may not follow that rule.
Found: 2026-10-25 plan r2-licence, new observation (follow-up of R3-12)
src/engine/license/LicenseManager.cpp numLines = fileSize / kLineLength (about :430): the number of entries comes from the file size, not from a stored count. The writer writes kHeaderBytes unsigned shorts (116 bytes) before the entries (LicenseWriter.cpp), so a valid file is 116 + n*690 bytes. A file cut by 117 bytes or more, up to one whole entry, reads as n-1 entries, with no error. A cut of 59 to 116 bytes damages the last entry and is now refused (R3-12).
A truncated licence (a bad copy, a full disk) quietly grants fewer licences than were issued. Nothing says the file is damaged; an unlimited licence hides the missing entry.
A size rule (size == 2*kHeaderBytes + n*kLineLength) would refuse such a file, but older licence files may not follow it. Owner decision needed on how old files are written, or a stored entry count in the header.
A file with two entries cut by 400 bytes: expect an error naming the file.
Medium: a size rule can refuse licences already issued.