From: Michael Wallner Date: Tue, 4 Dec 2018 10:25:10 +0000 (+0100) Subject: fix reading beyond actual size X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5637e16c2c56225bd92904498de691760535ac2a;p=m6w6%2Fext-psi fix reading beyond actual size --- diff --git a/src/types/let_exp.c b/src/types/let_exp.c index 382fd62..4ce32a2 100644 --- a/src/types/let_exp.c +++ b/src/types/let_exp.c @@ -247,9 +247,11 @@ void *psi_let_exp_exec(struct psi_let_exp *val, struct psi_decl_arg *darg, struct psi_impl *impl = psi_call_frame_get_impl(frame); struct psi_let_stmt *let_temp = psi_impl_get_let(impl, val->data.var); struct psi_call_frame_symbol *temp_arg; + impl_val *src; temp_arg = psi_call_frame_fetch_symbol(frame, let_temp->exp->var); - frame_sym->temp_val = *deref_impl_val(temp_arg->ptr, val->data.var); + src = deref_impl_val(temp_arg->ptr, val->data.var); + memcpy(&frame_sym->temp_val, src, psi_decl_var_get_size(let_temp->exp->var)); } break;