mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Remove use of sscanf in pg_upgrade, and add C comment to pg_dump
Per report from Jackie Chang
This commit is contained in:
@ -453,9 +453,10 @@ get_sock_dir(ClusterInfo *cluster, bool live_check)
|
||||
sscanf(line, "%hu", &old_cluster.port);
|
||||
if (lineno == LOCK_FILE_LINE_SOCKET_DIR)
|
||||
{
|
||||
cluster->sockdir = pg_malloc(MAXPGPATH);
|
||||
cluster->sockdir = pg_strdup(line);
|
||||
/* strip off newline */
|
||||
sscanf(line, "%s\n", cluster->sockdir);
|
||||
if (strchr(cluster->sockdir, '\n') != NULL)
|
||||
*strchr(cluster->sockdir, '\n') = '\0';
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
|
Reference in New Issue
Block a user