summaryrefslogtreecommitdiff
path: root/usr/src/lib/libuuid/common/uuid.c
diff options
context:
space:
mode:
authorgz161490 <none@none>2006-02-06 00:54:12 -0800
committergz161490 <none@none>2006-02-06 00:54:12 -0800
commit6be356c5780a1ccb886bba08d6eb56b61f021564 (patch)
treea98335d45cd04cb824568b31555764ee9ae4abc5 /usr/src/lib/libuuid/common/uuid.c
parent65cd9f2809a015b46790a9c5c2ef992d56177624 (diff)
downloadillumos-joyent-6be356c5780a1ccb886bba08d6eb56b61f021564.tar.gz
5105235 get_ethernet_address() could return wrong value and cause memory leak in libuuid
6305641 uuid_unparse function is unusable without a defined string length
Diffstat (limited to 'usr/src/lib/libuuid/common/uuid.c')
-rw-r--r--usr/src/lib/libuuid/common/uuid.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr/src/lib/libuuid/common/uuid.c b/usr/src/lib/libuuid/common/uuid.c
index 1be9fba0d1..c494f847d6 100644
--- a/usr/src/lib/libuuid/common/uuid.c
+++ b/usr/src/lib/libuuid/common/uuid.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -75,7 +75,6 @@
#define STATE_LOCATION "/var/sadm/system/uuid_state"
#define URANDOM_PATH "/dev/urandom"
#define MAX_RETRY 8
-#define UUID_PRINTF_SIZE 37
#define VER1_MASK 0xefff
static mutex_t ulock = DEFAULTMUTEX;
@@ -664,7 +663,7 @@ uuid_unparse(uuid_t uu, char *out)
/* XXX user should have allocated enough memory */
/*
- * if (strlen(out) < UUID_PRINTF_SIZE) {
+ * if (strlen(out) < UUID_PRINTABLE_STRING_LENGTH) {
* return;
* }
*/
@@ -680,7 +679,7 @@ uuid_unparse(uuid_t uu, char *out)
(void) snprintf(out, 25, "%08x-%04x-%04x-%04x-",
uuid.time_low, uuid.time_mid, uuid.time_hi_and_version,
clock_seq);
- (void) strlcat(out, etheraddr, UUID_PRINTF_SIZE);
+ (void) strlcat(out, etheraddr, UUID_PRINTABLE_STRING_LENGTH);
}
/*