1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

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
This commit is contained in:
Bruce Momjian
2002-08-28 20:46:24 +00:00
parent f5fea0808f
commit 81dfa2ce43
13 changed files with 33 additions and 37 deletions

View File

@ -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