shabiel / M-Web-Server

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

Decoder crashes on bad input #32

Closed shabiel closed 5 years ago

shabiel commented 5 years ago
FOIA201805-SYN>k  s in="{""test"":[4,3,2]}}"

FOIA201805-SYN>d decode^%webjson("in","out")
%YDB-E-LVUNDEF, Undefined local variable: VVSTACK(0)
        At M source location DIRECT+27^%webjsonDecode

FOIA201805-SYN>zsh
DIRECT+27^%webjsonDecode    ($ZTRAP)
    (Direct mode) 
DIRECT+26^%webjsonDecode
DIRECT+24^%webjsonDecode
+1^GTM$DMOD    (Direct mode) 

VVERR="^TMP(""%webjsonerr"",$J)"
VVERRORS=0
VVIDX=18
VVINPUT(1)="{""test"":[4,3,2]}}"
VVJSON="VVINPUT"
VVLINE=1
VVMAX=100
VVPROP=0
VVROOT="out("
VVSTACK=0
VVSTACK(1)="test"
VVSTACK(2)=3
VVTYPE="}"
XVV("$T")=1
XVV("ID")=0
in="{""test"":[4,3,2]}}"
out("test",1)=4
out("test",2)=3
out("test",3)=2
shabiel commented 5 years ago

This one fails too.

k s in="{""test"":[4,3,2]},"
d DECODE^VPRJSOND("in","json","jerr")