shabiel / M-Web-Server

A YottaDB and Caché compatible HTTP server
Apache License 2.0
24 stars 19 forks source link

Specially crafted JSON can cause incorrect results with the "\s" node #26

Open ChristopherEdwards opened 5 years ago

ChristopherEdwards commented 5 years ago

This test isn't valid JSON (and gives no errors as such) and based on validators it is working correctly. Just a placeholder incase this comes up in the future.

Test Case:

YDB>r JSON
{"name": {"\\s": "ok"}, "name": 42}
YDB>d DECODE^%webjson("JSON","OUT","ERR") ZWR OUT
OUT("name")=42
OUT("name","\s")="ok"

YDB>d ENCODE^%webjson("OUT","ENCODE","ERR") W ENCODE(1)
{"name":"42"}