summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-07-04 14:35:05 +0200
committerVolker Lendecke <vl@samba.org>2010-07-04 14:37:10 +0200
commit34558ae9458519f785c1fee48982b1efccaff446 (patch)
tree98011ecb628ade1252f71a6aaccb6a1c913ce49f /source3
parentf8e7077d5ca738a62386917c14aebce515955c68 (diff)
downloadsamba-34558ae9458519f785c1fee48982b1efccaff446.tar.gz
samba-34558ae9458519f785c1fee48982b1efccaff446.tar.bz2
samba-34558ae9458519f785c1fee48982b1efccaff446.zip
s3: Slight reshaping of server_exists_parse
Doing a copy and then do the compare is a bit pointless, use memcmp
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/serverid.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 5f97bd310f..e9c72961e6 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -183,10 +183,12 @@ static int server_exists_parse(TDB_DATA key, TDB_DATA data, void *priv)
return -1;
}
- /* memcpy, data.dptr might not be aligned */
- memcpy(&unique_id, data.dptr, sizeof(unique_id));
-
- state->exists = (state->id->unique_id == unique_id);
+ /*
+ * Use memcmp, not direct compare. data.dptr might not be
+ * aligned.
+ */
+ state->exists =
+ (memcmp(&unique_id, data.dptr, sizeof(unique_id)) == 0);
return 0;
}