• Andrew Dunstan's avatar
    Fix "path" infrastructure bug affecting jsonb_set() · 2271d002
    Andrew Dunstan authored
    jsonb_set() and other clients of the setPathArray() utility function
    could get spurious results when an array integer subscript is provided
    that is not within the range of int.
    
    To fix, ensure that the value returned by strtol() within setPathArray()
    is within the range of int;  when it isn't, assume an invalid input in
    line with existing, similar cases.  The path-orientated operators that
    appeared in PostgreSQL 9.3 and 9.4 do not call setPathArray(), and
    already independently take this precaution, so no change there.
    
    Peter Geoghegan
    2271d002
jsonfuncs.c 95.8 KB