7e191fd json: even stricter trailing garbage detection

2 files Authored by ericb 8 years ago, Committed by mprivozn 8 years ago,
    json: even stricter trailing garbage detection
    
    Since older yajl ignores trailing garbage, a client can cause
    problems by intentionally ending the wrapper array early. Since
    we already track nesting, it's not too much harder to reject
    invalid nesting pops.
    
    * src/util/virjson. (_virJSONParser): Add field.
    (virJSONValueFromString): Set witness.
    (virJSONParserHandleEndArray): Use it to catch abuse.
    * tests/jsontest.c (mymain): Test it.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+5 -2
file modified
+1 -0