From b71310d8e02f8f0b3006aa5e634f9218f0f0cedc Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Sun, 4 Aug 2002 06:44:47 +0000 Subject: 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. --- src/backend/utils/adt/varlena.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/utils/adt/varlena.c') 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()) -- cgit v1.2.3