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_decode: strings cut off after first null-byte #7

Open
Briareos opened this issue Sep 25, 2013 · 6 comments
Open

json_decode: strings cut off after first null-byte #7

Briareos opened this issue Sep 25, 2013 · 6 comments

Comments

@Briareos
Copy link

In json-c 1.3.2 executing

var_dump(json_decode('{"foo\u0000bar":"bar\u0000baz"}', true));

outputs

array(1) {
  ["foo"] =>
  string(3) "bar"
}

while in json 1.2.1 it outputs

array(1) {
  ["foobar"]=>
  string(7) "barbaz"
}

thus braking stuff mentioned here (among other things).

@remicollet
Copy link
Owner

Previous commit fix the decoding of "value".

For "key", this need some changes in json-c library, see json-c/json-c#108

@ParisLiakos
Copy link

Hi.
Will this fix https://drupal.org/node/2068593 or they are irrelevant and i should open a new issue for that?

@remicollet
Copy link
Owner

@ParisLiakos I think, but please, try the fix.
(or use Fedora 19 where the patch is already applied)

@ParisLiakos
Copy link

Yes that fixed it indeed:) I just tried it.
Thanks!

@yunosh
Copy link

yunosh commented Oct 30, 2013

Can anything be done to fix this locally if upstream doesn't respond?

@remicollet
Copy link
Owner

I don't see any simple solution. The library have already lost the data, so I don't see any way to resurrect it.

My plan is to try to merge the json-c into the extension, and thus being able to fix such behavior. Just something I'd like to avoid as musch as possible.

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

4 participants