View Issue Details

IDProjectCategoryView StatusLast Update
0008219Multi Theft Auto : San AndreasGeneralpublic2014-07-23 13:36
ReporterrafalhAssigned Tosbx320 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.4 
Summary0008219: toJSON/fromJSON doesn't handle binary data properly
Description

If string contains NUL character, its truncated.

Steps To Reproduce

toJSON('\0') returns [ "" ] and should return [ "\u0000" ] (this is what JSON.stringify returns in Firefox)

This assertion should not fail:
assert(fromJSON(toJSON('\0')) == '\0')

TagsNo tags attached.

Activities

sbx320

2014-05-02 21:12

administrator   ~~0020821

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=6366

mickdermack

2014-07-06 15:36

viewer   ~~0021254

Doesn't seem fixed.

sver
< MTA:SA Server v1.4-unstable-6647
run toJSON("\0")
< Command results: [ "" ] [string]

Patch:
http://cker.li/patches/mta/CLuaArgument_JSON-0byte.patch

sbx320

2014-07-23 13:35

administrator   ~~0021419

Something got lost somewhere in my commit I guess.

Applied your patch with some slight modifications as we discussed earlier. Sorry for the delay.

https://code.google.com/p/mtasa-blue/source/detail?r=6709

Issue History

Date Modified Username Field Change