BadInputs cause StackOverflow/Access Violation
kulgg opened this issue · 4 comments
Description
On certain inputs some v2.8 Datatype structures are stuck in an endless recursive loop calling their own constructor. This causes a StackOverflow Exception in net461 and an access violation exit in netcoreapp 3.1. This recursive loop is caused because the Datatype implementation is not according to the HL7 Definition.
Exceptions and Inputs
- StackOverflow/Access violation
b"MSH|^|||||||ADT^A40|||2.8\rIN2||||||||||||||||||||||||||||A"
b"MSH|^|||||||ADT^A40|||2.8\rIN2|||||||||||||||||||||||||||||A"
Environmental Details
- OS: Ubuntu 20.04
- Target Framework net641, netcoreapp3.1, probably generally
- Version 3.0.0 preview 2
Additional context
The 2.8 Datatypes RMC, PTA and PPN implemented withdrawn fields wrongly.
See 2A.3.65, 2A.3.59 and 2A.3.56 of spec.
@JlKmn again thank you for this.
The message structures specific to each hl7 version are generated from the HL7 database. Which suggests perhaps the database also needs updating, I'll have a look into this and reach out to the maintainer of the database if this is the case.
@JlKmn is this fixed by #197
Yes
I decided to add the solution in there