1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-20 05:03:10 +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

@ -1,7 +1,7 @@
/*
* PostgreSQL type definitions for MAC addresses.
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/mac.c,v 1.24 2002/06/17 07:00:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/mac.c,v 1.25 2002/08/28 20:46:24 momjian Exp $
*/
#include "postgres.h"
@ -80,7 +80,7 @@ macaddr_out(PG_FUNCTION_ARGS)
result = (char *) palloc(32);
sprintf(result, "%02x:%02x:%02x:%02x:%02x:%02x",
snprintf(result, 32, "%02x:%02x:%02x:%02x:%02x:%02x",
addr->a, addr->b, addr->c, addr->d, addr->e, addr->f);
PG_RETURN_CSTRING(result);