Skip to content

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

Closed

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:

Activity

  1. added a commit that references this issue on Nov 9, 2025
    6b1eb17
  2. samatstariongroup commented on Nov 9, 2025

    @samatstariongroup
    Member

    @PaulMartinsen please have a look at PR #61, i think this implements your suggestion

  3. PaulMartinsen commented on Nov 12, 2025

    @PaulMartinsen
    Author

    Apologies for the tardy reply; its been a crazy week & thanks @samatstariongroup for addressing this so quickly. Much appreciated. Agree it resolves the issue I hit.

  4. added a commit that references this issue on Nov 12, 2025
    eb66a73
  5. samatstariongroup commented on Nov 12, 2025

    @samatstariongroup
    Member

    @PaulMartinsen new nugets have been released that fix this issue. The release notes provide an overview of what has been fixed in this version, a bit more than just this issue :-)

    https://github.com/STARIONGROUP/reqifsharp/releases/tag/10.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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