summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
}