8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f422db commit 0d9b092Copy full SHA for 0d9b092
src/backend/utils/adt/misc.c
@@ -287,9 +287,12 @@ pg_tablespace_location(PG_FUNCTION_ARGS)
287
*/
288
snprintf(sourcepath, sizeof(sourcepath), "pg_tblspc/%u", tablespaceOid);
289
rllen =readlink(sourcepath, targetpath, sizeof(targetpath));
290
- if (rllen < 0 || rllen >= sizeof(targetpath))
+ if (rllen < 0)
291
ereport(ERROR,
292
(errmsg("could not read symbolic link \"%s\": %m", sourcepath)));
293
+ else if (rllen >= sizeof(targetpath))
294
+ ereport(ERROR,
295
+ (errmsg("symbolic link \"%s\" target is too long", sourcepath)));
296
targetpath[rllen] = '\0';
297
298
PG_RETURN_TEXT_P(cstring_to_text(targetpath));
0 commit comments