From 76ca46ecfe469e11ccc4d20647ebc88ec4b10973 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 6 Jan 2012 16:42:08 +0100 Subject: s3: Avoid a potential alignment requirement issue Autobuild-User: Volker Lendecke Autobuild-Date: Fri Jan 6 18:58:11 CET 2012 on sn-devel-104 --- source3/torture/torture.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source3') diff --git a/source3/torture/torture.c b/source3/torture/torture.c index 8bc9cefeef..3b023e7329 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -8515,7 +8515,7 @@ fail: static bool dbtrans_inc(struct db_context *db) { struct db_record *rec; - uint32_t *val; + uint32_t val; bool ret = false; NTSTATUS status; TDB_DATA value; @@ -8534,12 +8534,11 @@ static bool dbtrans_inc(struct db_context *db) goto fail; } - val = (uint32_t *)value.dptr; - *val += 1; + memcpy(&val, value.dptr, sizeof(val)); + val += 1; - status = dbwrap_record_store(rec, make_tdb_data((uint8_t *)val, - sizeof(uint32_t)), - 0); + status = dbwrap_record_store( + rec, make_tdb_data((uint8_t *)&val, sizeof(val)), 0); if (!NT_STATUS_IS_OK(status)) { printf(__location__ "store failed: %s\n", nt_errstr(status)); -- cgit