]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix ptr vulnerability
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Thu, 1 Oct 2020 18:55:45 +0000 (20:55 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Thu, 1 Oct 2020 18:55:57 +0000 (20:55 +0200)
src/lib/ptr.c

index 2cfbefb250c49fc02db9ecb2e530ea7d1e892c23..2012bf5ba45c6830c69a41a0f108f9c922aeb37f 100644 (file)
@@ -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");