Browse Source

Bug 690882 - (cov#10571) Incorrect sizeof use in uuid code

It looks like the caller wanted to clear out the uuid struct if
there was a problem creating the NSS context. The problem is that
the memset at line 341 is only clearing out the local pointer to
the struct. This local pointer is never seen by the caller and the
struct retains whetever it previously held in memory. We need to
clear out the contents of the struct itself instead of just
clearing the address held by the local pointer.
Nathan Kinder 14 years ago
parent
commit
76561dba96
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ldap/servers/slapd/uuid.c

+ 1 - 1
ldap/servers/slapd/uuid.c

@@ -338,7 +338,7 @@ void uuid_create_from_name(guid_t * uuid,      /* resulting UUID */
 		PK11_DestroyContext(c, PR_TRUE);
 	}
 	else { /* Probably desesperate but at least deterministic... */
-		memset(&uuid, 0, sizeof(uuid));
+		memset(uuid, 0, sizeof(*uuid));
 	}
 }