From 27291b4486dbf366d8978ab49fbd8ac3bcb8189c Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Mon, 30 Sep 2019 11:28:32 +0200 Subject: [PATCH] eolian: fix potential ABI violation in expr serialization While this may seem safe, and likely is on any 64-bit system, it may not be entirely well defined. And in this case we should not have to worry about copying. Maybe fixes T8276... --- src/lib/eolian/database_expr_api.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/eolian/database_expr_api.c b/src/lib/eolian/database_expr_api.c index 6aaa1bb9be..2d3f81c73d 100644 --- a/src/lib/eolian/database_expr_api.c +++ b/src/lib/eolian/database_expr_api.c @@ -152,8 +152,10 @@ _expr_serialize(const Eolian_Expression *expr, Eina_Strbuf *buf, Eina_Bool outer case EOLIAN_EXPR_STRING: case EOLIAN_EXPR_CHAR: { - Eolian_Value *v = (Eolian_Value*)&expr->type; - const char *x = eolian_expression_value_to_literal(v); + Eolian_Value v; + v.type = expr->type; + v.value = expr->value; + const char *x = eolian_expression_value_to_literal(&v); if (!x) return EINA_FALSE; eina_strbuf_append(buf, x);