The branch, master has been updated
       via  c2de842 s3:talloc_dict: fix a SIGBUS when dereferencing unaligned 
pointers
      from  a84eed5 lib/param: add a fixed unified 
lpcfg_string_{free,set,set_upper}() infrastructure

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit c2de8425d9a33baeb743a611c8169131b975f179
Author: Ralph Boehme <[email protected]>
Date:   Thu Nov 26 11:10:38 2015 +0100

    s3:talloc_dict: fix a SIGBUS when dereferencing unaligned pointers
    
    Signed-off-by: Ralph Boehme <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    Autobuild-User(master): Ralph Böhme <[email protected]>
    Autobuild-Date(master): Mon Nov 30 22:31:16 CET 2015 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/talloc_dict.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/talloc_dict.c b/source3/lib/talloc_dict.c
index 71ab899..7594679 100644
--- a/source3/lib/talloc_dict.c
+++ b/source3/lib/talloc_dict.c
@@ -72,7 +72,7 @@ bool talloc_dict_set(struct talloc_dict *dict, DATA_BLOB key, 
void *pdata)
                        TALLOC_FREE(rec);
                        return false;
                }
-               old_data = *(void **)(value.dptr);
+               memcpy(&old_data, value.dptr, sizeof(old_data));
                TALLOC_FREE(old_data);
                if (data == NULL) {
                        status = dbwrap_record_delete(rec);
@@ -138,6 +138,7 @@ static int talloc_dict_traverse_fn(struct db_record *rec, 
void *private_data)
        TDB_DATA value;
        struct talloc_dict_traverse_state *state =
                (struct talloc_dict_traverse_state *)private_data;
+       void *p;
 
        key = dbwrap_record_get_key(rec);
        value = dbwrap_record_get_value(rec);
@@ -145,8 +146,10 @@ static int talloc_dict_traverse_fn(struct db_record *rec, 
void *private_data)
        if (value.dsize != sizeof(void *)) {
                return -1;
        }
+
+       memcpy(&p, value.dptr, sizeof(p));
        return state->fn(data_blob_const(key.dptr, key.dsize),
-                        *(void **)value.dptr, state->private_data);
+                        p, state->private_data);
 }
 
 /*


-- 
Samba Shared Repository

Reply via email to