Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json parser successfully parses malformed json without raising an issue (numeric literals) #33

Open
Rumata888 opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Rumata888
Copy link

Aim

Test if malformed input is handled correctly

Expected Behavior

Assertion failure (the test should have failed)

Bug

Json parser doesn't raise an error on sudden numeric literal property if it is followed by \n

To Reproduce

#[test(should_fail)]
fn numeric_literal() {
    let json_string = "{1\n:0}";

    let json_string_bytes = json_string.as_bytes();
    let mut json_buffer = [32; 512];
    for i in 0..json_string_bytes.len() {
        json_buffer[512 - json_string_bytes.len() + i] = json_string_bytes[i];
    }
    let json = JSON512b::parse_json(json_buffer);
}

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

nargo version = 1.0.0-beta.1 noirc version = 1.0.0-beta.1+d1f5f105719b1a881f7a68df09917d332bcf19de (git version hash: d1f5f105719b1a881f7a68df09917d332bcf19de, is dirty: true)

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@Rumata888 Rumata888 added the bug Something isn't working label Feb 5, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Libraries Feb 5, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Feb 5, 2025
zac-williamson added a commit that referenced this issue Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Status: 📋 Backlog
Development

No branches or pull requests

1 participant