Skip to content

json_decode strictness - parsing string literals #100

@zergin

Description

@zergin

Hi,
following up on a chain of issuses[1],[2] - there is a parsing strictness issue in json-c where invalid literals are parsed as valid JSON:

234easdasg34

is not a valid JSON [3] but json-c seems to extract the first digits breaking on first invalid character and then returning the parsed part as correct result (this is observed behaviour through PHP inclusion; I haven't built and tested json-c directly yet).

[1] remicollet/pecl-json-c#5
[2] https://bugs.php.net/bug.php?id=65499
[3] http://www.ietf.org/rfc/rfc4627.txt - section 2.1, 2.4

Metadata

Metadata

Assignees

No one assigned

    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