summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-30 11:28:32 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-30 11:32:41 +0200
commit27291b4486dbf366d8978ab49fbd8ac3bcb8189c (patch)
tree3cec8be354e0b4d33e5850a9370504abc0a9973b /src/lib
parent5ac1f52af9607e1937701b4504fa03c090d38d6f (diff)
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...
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eolian/database_expr_api.c6
1 files 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
152 case EOLIAN_EXPR_STRING: 152 case EOLIAN_EXPR_STRING:
153 case EOLIAN_EXPR_CHAR: 153 case EOLIAN_EXPR_CHAR:
154 { 154 {
155 Eolian_Value *v = (Eolian_Value*)&expr->type; 155 Eolian_Value v;
156 const char *x = eolian_expression_value_to_literal(v); 156 v.type = expr->type;
157 v.value = expr->value;
158 const char *x = eolian_expression_value_to_literal(&v);
157 if (!x) 159 if (!x)
158 return EINA_FALSE; 160 return EINA_FALSE;
159 eina_strbuf_append(buf, x); 161 eina_strbuf_append(buf, x);