Skip to content

[Bug] JSON with null values are not parsed correctly #2670

@arakir

Description

@arakir

Operating System

Windows

What's the issue you encountered?

When using hex::type::Json type on json string with null values some json fields are ignored or fields contains values from other fields.

How can the issue be reproduced?

Parsed file:

{ "aaa": "str", "bbb": null, "ccc": 5 }

Pattern:

#include <hex/type/json.pat>

hex::type::Json<sizeof($)> json @ 0x00;

Using these, you can see in Pattern Data there is missing aaa field and bbb field has value of "str".

Also if first value (alphabeticaly) has value of null in json it will crash ImHex editor. Can be achieved by switching names of aaa/bbb in example.

20260302_222630.log

ImHex Version

1.38.1

ImHex Build Type

  • Nightly or built from sources

Installation type

Portable

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions