Fix unaligned access to 64 bits payload
This commit is contained in:
parent
e5448af6d8
commit
c8b95313ff
@ -363,8 +363,9 @@ print_arg(struct ev_arg *arg, const char *fmt, struct cursor *c, struct emu_ev *
|
|||||||
|
|
||||||
#define CASE(TYPE) \
|
#define CASE(TYPE) \
|
||||||
do { \
|
do { \
|
||||||
TYPE *data = (TYPE *) &payload[arg->offset]; \
|
TYPE data; \
|
||||||
n = snprintf(c->out, (size_t) c->len, fmt, *data); \
|
memcpy(&data, &payload[arg->offset], sizeof(data)); \
|
||||||
|
n = snprintf(c->out, (size_t) c->len, fmt, data); \
|
||||||
if (n >= c->len) { \
|
if (n >= c->len) { \
|
||||||
err("no space for argument"); \
|
err("no space for argument"); \
|
||||||
return -1; \
|
return -1; \
|
||||||
|
Loading…
Reference in New Issue
Block a user