Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008768opensim[REGION] Script Functionspublic2020-09-07 17:092020-09-07 19:29
ReporterKristen Mynx 
Assigned ToKristen Mynx 
PlatformOSOS Version
Product Version0.9.1.0 
Target VersionFixed in Version 
Summary0008768: 0.9.1.* and llList2Json() fails when passed an empty string value
DescriptionllList2Json returns JSON_INVALID when any value of the list passed in is an empty string. It occurs on JSON_OBJECT or JSON_ARRAY.

I've attached a patch to fix the problem. (JsonEmptyString.patch)

It is caused by referencing the first character of a string without first checking if there are any characters in the string. This throws an exception, which the upper level code translates into JSON_INVALID.

Steps To ReproduceRez a box
New Script
Copy/Paste in the script in Additional Information
Result will be:
[17:00] json test: ?
Result Should be:
[17:00] json test: {"NameWithEmptyValue":""}

Additional Informationlist jsonin = [
"NameWithEmptyValue", ""

        string json = llList2Json(JSON_OBJECT, jsonin);
TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region) , Standalone (Multiple Regions) , Grid (1 Region per Sim) , Grid (Multiple Regions per Sim)
Physics EngineBasicPhysics, ODE, BulletSim, ubODE, Other
Script EngineXEngine, YEngine
EnvironmentMono / Linux32, Mono / Linux64, Mono / Windows, Mono / OSX, .NET / Windows32, .NET / Windows64
Mono VersionNone
Attached Filespatch file icon JsonEmptyString.patch [^] (843 bytes) 2020-09-07 17:09 [Show Content]

- Relationships

-  Notes
UbitUmarov (administrator)
2020-09-07 17:32

thanks, should be better now
for some reason your patch failed automatic apply,
but easy done by hand and a bit different
Kristen Mynx (reporter)
2020-09-07 19:29

Works as of b9c68b 2020-09-08 00:29:22

- Issue History
Date Modified Username Field Change
2020-09-07 17:09 Kristen Mynx New Issue
2020-09-07 17:09 Kristen Mynx File Added: JsonEmptyString.patch
2020-09-07 17:32 UbitUmarov Note Added: 0036803
2020-09-07 19:29 Kristen Mynx Note Added: 0036806
2020-09-07 19:29 Kristen Mynx Status new => resolved
2020-09-07 19:29 Kristen Mynx Resolution open => fixed
2020-09-07 19:29 Kristen Mynx Assigned To => Kristen Mynx

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker