• Thomas Munro's avatar
    Fix parsePGArray() error checking in pg_dump. · 3636efa1
    Thomas Munro authored
    Coverity complained about a defect in commit 257836a7:
    
      Calling "parsePGArray" without checking return value (as is
      done elsewhere 11 out of 13 times).
    
    Fix, and also check for empty strings explicitly (NULL as represented by
    PQgetvalue()).  That worked correctly before only because parsePGArray()
    happens to set *nitems = 0 when it fails on an empty string.  Also
    convert a sanity check assertion to an error to be more paranoid, and
    pgindent a nearby line.
    Reported-by: default avatarMichael Paquier <michael@paquier.xyz>
    3636efa1
pg_dump.c 565 KB