From 81dfa2ce4328c44201a70a9dc3517bd356698069 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 28 Aug 2002 20:46:24 +0000 Subject: backend where a statically sized buffer is written to. Most of these should be pretty safe in practice, but it's probably better to be safe than sorry. I was actually looking for cases where NAMEDATALEN is assumed to be 32, but only found one. That's fixed too, as well as a few bits of code cleanup. Neil Conway --- src/backend/utils/adt/varlena.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 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 9f8a4d563ee..52598aba9e8 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.88 2002/08/22 03:24:00 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.89 2002/08/28 20:46:24 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1787,12 +1787,11 @@ to_hex32(PG_FUNCTION_ARGS) { static char digits[] = "0123456789abcdef"; char buf[32]; /* bigger than needed, but reasonable */ - char *ptr, - *end; + char *ptr; text *result_text; int32 value = PG_GETARG_INT32(0); - end = ptr = buf + sizeof(buf) - 1; + ptr = buf + sizeof(buf) - 1; *ptr = '\0'; do @@ -1814,12 +1813,11 @@ to_hex64(PG_FUNCTION_ARGS) { static char digits[] = "0123456789abcdef"; char buf[32]; /* bigger than needed, but reasonable */ - char *ptr, - *end; + char *ptr; text *result_text; int64 value = PG_GETARG_INT64(0); - end = ptr = buf + sizeof(buf) - 1; + ptr = buf + sizeof(buf) - 1; *ptr = '\0'; do -- cgit v1.2.3