From: Jérémie Astor Date: Thu, 1 Oct 2020 18:55:45 +0000 (+0200) Subject: :bug: Fix ptr vulnerability X-Git-Tag: nightly~1252 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=00f7ca8a73bd1ddfedb3d853d8e5ace05a39c791;p=gwion.git :bug: Fix ptr vulnerability --- diff --git a/src/lib/ptr.c b/src/lib/ptr.c index 2cfbefb2..2012bf5b 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -138,7 +138,7 @@ static DTOR(ptr_struct_dtor) { static OP_CHECK(opck_ptr_scan) { struct TemplateScan *ts = (struct TemplateScan*)data; - const Type t = (Type)scan_class(env, ts->t, ts->td); + DECL_ON(const Type, t, = (Type)scan_class(env, ts->t, ts->td)) const Type base = known_type(env, t->e->def->base.tmpl->call->td); if(isa(base, env->gwion->type[et_compound]) > 0 && !t->nspc->dtor) { t->nspc->dtor = new_vm_code(env->gwion->mp, NULL, SZ_INT, ae_flag_member | ae_flag_builtin, "@PtrDtor");