aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/varlena.c
diff options
context:
space:
mode:
authorThomas G. Lockhart <lockhart@fourpalms.org>2002-08-04 06:44:47 +0000
committerThomas G. Lockhart <lockhart@fourpalms.org>2002-08-04 06:44:47 +0000
commitb71310d8e02f8f0b3006aa5e634f9218f0f0cedc (patch)
treeed7c3250bae2f4b46f56910477dcf994287fdadf /src/backend/utils/adt/varlena.c
parente025bb7a725610e327401d7afacedaad7079b989 (diff)
downloadpostgresql-b71310d8e02f8f0b3006aa5e634f9218f0f0cedc.tar.gz
postgresql-b71310d8e02f8f0b3006aa5e634f9218f0f0cedc.zip
Add guard code to protect from buffer overruns on long date/time input
strings. Should go back in and look at doing this a bit more elegantly and (hopefully) cheaper. Probably not too bad anyway, but it seems a shame to scan the strings twice: once for length for this buffer overrun protection, and once to parse the line. Remove use of pow() in date/time handling; was already gone from everything *but* the time data types. Define macros for handling typmod manipulation for date/time types. Should be more robust than all of that brute-force inline code. Rename macros for masking and typmod manipulation to put TIMESTAMP_ or INTERVAL_ in front of the macro name, to reduce the possibility of name space collisions.
Diffstat (limited to 'src/backend/utils/adt/varlena.c')
-rw-r--r--src/backend/utils/adt/varlena.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index b3ff70d43bd..bdcffa954e0 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.86 2002/06/20 20:29:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.87 2002/08/04 06:44:47 thomas Exp $
*
*-------------------------------------------------------------------------
*/
@@ -550,7 +550,7 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2)
/*
* Unfortunately, there is no strncoll(), so in the non-C locale
* case we have to do some memory copying. This turns out to be
- * significantly slower, so we optimize the case were LC_COLLATE
+ * significantly slower, so we optimize the case where LC_COLLATE
* is C.
*/
if (!lc_collate_is_c())