ceb496e json: fully parse input string

Authored and Committed by ericb 8 years ago
    json: fully parse input string
    
    I was adding a JSON test, and was shocked to find out our parser
    treated the input string of "1" as invalid JSON.  It turns out
    that YAJL specifically documents that it buffers input, and that
    if the last input read could be a prefix to a longer token, then
    you have to explicitly tell the parser that the buffer has ended
    before that token will be processed.
    
    It doesn't help that yajl 2 renamed the function from what it was
    in yajl 1.
    
    * src/util/virjson.c (virJSONValueFromString): Complete parse, in
    case buffer ends in possible token prefix.
    * tests/jsontest.c (mymain): Expose the problem.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>
    
        
file modified
+3 -1
file modified
+6 -0