basebackup: correctly terminate readlink() buffer
Buffer corruption was caused by not correctly terminating the
readlink(), as of commit We restored a previous line of code
that allows correct termination.
@@ -1251,6 +1251,7 @@ sendDir(char *path, int basepathlen, bool sizeonly, List *tablespaces,
ereport(ERROR,
(errmsg("symbolic link \"%s\" target is too long",
pathbuf)));
+ linkpath[rllen] = '\0';
/* Lop off the dbid before sending the link target. */
char *file_sep_before_dbid_in_link_path = strrchr(linkpath, '/');
