Skip to content

Deserialization crashes when DATATYPE-DEFINITION-STRING/@MAX-LENGTH is UInt32.Max #60

@PaulMartinsen

Description

@PaulMartinsen

What type of issue is this?

  • Bug report
  • Feature request

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the reqifsharp
  • I have searched open and closed issues to ensure it has not already been reported

Description

Deserialization crashes in DatatypeDefinitionString::ReadXml with the following fragment in the ReqIF file:

        <DATATYPE-DEFINITION-STRING DESC="Any string without formatting."
                                    IDENTIFIER="_U62Ck58zEeqqT_YuDrpRtg"
                                    LAST-CHANGE="2020-05-26T11:28:58.424+02:00"
                                    LONG-NAME="T_String"
                                    MAX-LENGTH="4294967295"/>

This happens because ReadXml parses the length as a 32 bit integer but the value is too large to store. A reasonable work around might be to catch the System.OverflowException and just store int.MaxValue in MaxLength.

Steps to Reproduce

System Configuration

  • reqifsharp version: 9.2.4
  • Environment (Operating system, version and so on):
  • .NET Framework version: 9
  • Additional information:

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions