summaryrefslogtreecommitdiff
path: root/usr/src/lib/libuuid/common/etheraddr.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/etheraddr.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/etheraddr.c')
-rw-r--r--usr/src/lib/libuuid/common/etheraddr.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/usr/src/lib/libuuid/common/etheraddr.c b/usr/src/lib/libuuid/common/etheraddr.c
index 901888e646..527a82c98d 100644
--- a/usr/src/lib/libuuid/common/etheraddr.c
+++ b/usr/src/lib/libuuid/common/etheraddr.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2000,2002 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -845,8 +845,8 @@ get_ethernet_address(uuid_node_t *node)
/*
* go get all interface names
*/
- if (get_net_if_names(&ifnames) == 0) {
- return (0);
+ if (get_net_if_names(&ifnames) != 0) {
+ return (-1);
}
/*
@@ -864,14 +864,14 @@ get_ethernet_address(uuid_node_t *node)
ifname = ifnames[i];
/* Gross hack to avoid getting errors from /dev/lo0 */
if (strcmp(ifname, LOOPBACK_IF) != 0) {
- if (dlpi_get_address(ifname, &addr) == 0) {
- bcopy(&addr, node, 6);
- /*
- * found one, set result to successful
- */
- found = 0;
- continue;
- }
+ if (dlpi_get_address(ifname, &addr) == 0) {
+ bcopy(&addr, node, 6);
+ /*
+ * found one, set result to successful
+ */
+ found = 0;
+ continue;
+ }
}
i++;
}