Coverity complained about a possible overrun in the copy, but there is
no actual need to copy the string at all.
{
Oid db_oid = InvalidOid;
char db_oid_str[MAXPGPATH + 1] = "";
- char dbname[MAXPGPATH + 1] = "";
+ char *dbname;
/* Extract dboid. */
sscanf(line, "%u", &db_oid);
sscanf(line, "%20s", db_oid_str);
- /* Now copy dbname. */
- strcpy(dbname, line + strlen(db_oid_str) + 1);
+ /* dbname is the rest of the line */
+ dbname = line + strlen(db_oid_str) + 1;
/* Remove \n from dbname. */
dbname[strlen(dbname) - 1] = '\0';