summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-01-06 16:42:08 +0100
committerVolker Lendecke <vlendec@samba.org>2012-01-06 18:58:11 +0100
commit76ca46ecfe469e11ccc4d20647ebc88ec4b10973 (patch)
tree288d5f8bf16bcf32e6a8806970f83a188707aae1 /source3/torture
parent421aab2e12d3890fe16924ce0a7ad16008a2ec79 (diff)
downloadsamba-76ca46ecfe469e11ccc4d20647ebc88ec4b10973.tar.gz
samba-76ca46ecfe469e11ccc4d20647ebc88ec4b10973.tar.bz2
samba-76ca46ecfe469e11ccc4d20647ebc88ec4b10973.zip
s3: Avoid a potential alignment requirement issue
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Jan 6 18:58:11 CET 2012 on sn-devel-104
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/torture.c11
1 files changed, 5 insertions, 6 deletions
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));