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

-Infinity values are not handled correctly in JSON #703

Open
rajsite opened this issue Mar 20, 2024 · 2 comments
Open

-Infinity values are not handled correctly in JSON #703

rajsite opened this issue Mar 20, 2024 · 2 comments

Comments

@rajsite
Copy link
Member

rajsite commented Mar 20, 2024

A user found that when using UnflattenFromJSON for double arrays, if the JSON string encounters -Infinity then:

  1. The node errors with code -375011
  2. The node returns an array with partially parsed results

See forum: https://forums.ni.com/t5/G-Web-Development-Software/Bug-on-Unflatten-from-JSON/m-p/4361814#M702

image

Didn't thoroughly debug but scanning source the following line looks suspicious which seems to indicate that any negative value will not be treated like Infinity:

(leadingChar == '.' || leadingChar == '-' || isdigit(leadingChar)); // not inf, nan

@spathiwa
Copy link
Contributor

Agreed, it looks like that line will cause a -Inf to be treated as if it was an overflow a few lines below and return an error.

@rajsite
Copy link
Member Author

rajsite commented Mar 28, 2024

Created two AzDo bugs for the issue:

  1. Lack of support for -Infinity
  2. Returning partial / incorrect results on error (effectively user data corruption on error)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants