diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2015-11-02 19:03:26 +0000 |
---|---|---|
committer | Heiko Schlittermann (HS12-RIPE) <hs@schlittermann.de> | 2015-11-03 17:38:51 +0100 |
commit | 1bd52978055bc07dfa150d296ffb344f10fff7fe (patch) | |
tree | 66fa821b70edfa400a6d742b72e6a466b3073f8e | |
parent | c4dcf906ceb3a45c6b30f76476d73ca836b262cd (diff) | |
download | exim4-1bd52978055bc07dfa150d296ffb344f10fff7fe.tar.gz |
Avoid misaligned access in cached lookup. Bug 1708
(cherry picked from commit 98b98887f926be87eabccc7919e57ce625c63c03)
-rw-r--r-- | doc/doc-txt/ChangeLog | 2 | ||||
-rw-r--r-- | src/src/search.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index cb4354730..0fd492772 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -28,6 +28,8 @@ JH/07 Bug 1678: Always record an interface option value, if set, as part of a different interface settings and the retry behaviour needs to be kept distinct. +JH/13 Bug 1708: avoid misaligned access in cached lookup. + Exim version 4.86 ----------------- JH/01 Bug 1545: The smtp transport option "retry_include_ip_address" is now diff --git a/src/src/search.c b/src/src/search.c index cd522dae8..ccad25021 100644 --- a/src/src/search.c +++ b/src/src/search.c @@ -540,10 +540,10 @@ else } else { - t = store_get(sizeof(tree_node) + len + sizeof(expiring_data)); - e = (expiring_data *)((char *)t + sizeof(tree_node) + len); + e = store_get(sizeof(expiring_data) + sizeof(tree_node) + len); e->expiry = do_cache == UINT_MAX ? 0 : time(NULL)+do_cache; e->ptr = data; + t = (tree_node *)(e+1); memcpy(t->name, keystring, len); t->data.ptr = e; tree_insertnode(&c->item_cache, t); |