• Tom Lane's avatar
    Fix assorted inconsistencies in our calls of readlink(). · 32f628be
    Tom Lane authored
    Ensure that we null-terminate the result string (one place in pg_rewind).
    Be paranoid about out-of-range results from readlink() (should not happen,
    but there is no good reason for some call sites to be careful about it and
    others not).  Consistently use the whole buffer, not sometimes one byte
    less.  Ensure we emit an appropriate errcode() in all cases.  Spell the
    error messages the same way.
    
    The only serious bug here is the missing null-termination in pg_rewind,
    which is new code, so no need for a back-patch.
    
    Abhijit Menon-Sen and Tom Lane
    32f628be
basebackup.c 35.2 KB