diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-08-28 20:46:24 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-08-28 20:46:24 +0000 |
commit | 81dfa2ce4328c44201a70a9dc3517bd356698069 (patch) | |
tree | ec11b0649abcb6cd2b3cb6926ff4df21ac1e570d /src/backend/utils/adt/mac.c | |
parent | f5fea0808f385677dccffa0b4dc0ffe512cb4199 (diff) | |
download | postgresql-81dfa2ce4328c44201a70a9dc3517bd356698069.tar.gz postgresql-81dfa2ce4328c44201a70a9dc3517bd356698069.zip |
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
Diffstat (limited to 'src/backend/utils/adt/mac.c')
-rw-r--r-- | src/backend/utils/adt/mac.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/mac.c b/src/backend/utils/adt/mac.c index 832c5cb4f84..c12163921db 100644 --- a/src/backend/utils/adt/mac.c +++ b/src/backend/utils/adt/mac.c @@ -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); |