diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2013-10-16 18:25:18 +0900 |
---|---|---|
committer | Cedric Bail <cedric.bail@free.fr> | 2013-10-17 20:50:30 +0900 |
commit | d8853401f834b59a1a2a9cebb6939bc9c4b13e1b (patch) | |
tree | 73303094864969757e2c1b8a1b3ef02f5834a6a8 | |
parent | a3c48bde5b35b34a24d4f08fe78de63af04db1b7 (diff) | |
download | efl-devs/cedric/cserve2.tar.gz |
evas/cserve2: Fix SIGBUS on ARM devicesdevs/cedric/cserve2
Unaligned access to Evas_Image_Load_Opts fields is not possible
on (many) ARM devices, as it will cause a SIGBUS.
Solution: copy the data into a stack buffer.
-rw-r--r-- | src/bin/evas/evas_cserve2_main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bin/evas/evas_cserve2_main.c b/src/bin/evas/evas_cserve2_main.c index 05def93c9c..1e8fd182dc 100644 --- a/src/bin/evas/evas_cserve2_main.c +++ b/src/bin/evas/evas_cserve2_main.c @@ -137,6 +137,7 @@ _cserve2_client_open(Client *client) Msg_Open *msg = (Msg_Open *)client->msg.buf; const char *path, *key, *end; Evas_Image_Load_Opts *opts = NULL; + Evas_Image_Load_Opts opts_copy; path = ((const char *)msg) + sizeof(*msg) + msg->path_offset; key = ((const char *)msg) + sizeof(*msg) + msg->key_offset; @@ -148,7 +149,10 @@ _cserve2_client_open(Client *client) if (!key[0]) key = NULL; if (msg->has_load_opts) - opts = (Evas_Image_Load_Opts *) end; + { + opts = &opts_copy; + memcpy(&opts_copy, end, sizeof(opts_copy)); + } cserve2_cache_file_open(client, msg->file_id, path, key, msg->base.rid, opts); |