• Tom Lane's avatar
    Fix IsValidJsonNumber() to notice trailing non-alphanumeric garbage. · e6ecc93a
    Tom Lane authored
    Commit e09996ff was one brick shy of a load: it didn't insist
    that the detected JSON number be the whole of the supplied string.
    This allowed inputs such as "2016-01-01" to be misdetected as valid JSON
    numbers.  Per bug #13906 from Dmitry Ryabov.
    
    In passing, be more wary of zero-length input (I'm not sure this can
    happen given current callers, but better safe than sorry), and do some
    minor cosmetic cleanup.
    e6ecc93a
json.c 62.9 KB