diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-01-01 04:48:49 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-01-01 04:48:49 +0000 |
commit | f0fbd7b87e4b2e282c2cb7cd448214770d6af9bd (patch) | |
tree | 94e78b45d539c61400c9c418582e24b90e395e19 /src/backend/utils/sort/psort.c | |
parent | d8ae7ffb2f81587d513951e5244f5cd97db508e8 (diff) | |
download | postgresql-f0fbd7b87e4b2e282c2cb7cd448214770d6af9bd.tar.gz postgresql-f0fbd7b87e4b2e282c2cb7cd448214770d6af9bd.zip |
Some security, since we now have vsnprintf, I remade an old patch
with some extra ugly sprintfs fixed. More work in this area is
needed still.
Göran Thyni
Diffstat (limited to 'src/backend/utils/sort/psort.c')
-rw-r--r-- | src/backend/utils/sort/psort.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/sort/psort.c b/src/backend/utils/sort/psort.c index d73be1210b0..76daa0351ee 100644 --- a/src/backend/utils/sort/psort.c +++ b/src/backend/utils/sort/psort.c @@ -4,7 +4,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: psort.c,v 1.45 1998/12/14 08:11:14 scrappy Exp $ + * $Id: psort.c,v 1.46 1999/01/01 04:48:49 momjian Exp $ * * NOTES * Sorts the first relation into the second relation. @@ -1019,7 +1019,8 @@ gettape() tp = (struct tapelst *) palloc((unsigned) sizeof(struct tapelst)); - sprintf(uniqueName, "%spg_psort.%d.%d", TEMPDIR, (int) MyProcPid, uniqueFileId); + snprintf(uniqueName, MAXPGPATH - 1, "%spg_psort.%d.%d", + TEMPDIR, (int) MyProcPid, uniqueFileId); uniqueFileId++; tapeinit = 1; |