Fix heap use after free
In a lua script, if object was created inside a container, it might've merged with another object. Also prevent stacking, lighting, and burying contained objects.
This commit is contained in:
+4
-3
@@ -2239,7 +2239,7 @@ struct mkroom *croom;
|
|||||||
|
|
||||||
remove_object(otmp);
|
remove_object(otmp);
|
||||||
if (cobj) {
|
if (cobj) {
|
||||||
(void) add_to_container(cobj, otmp);
|
otmp = add_to_container(cobj, otmp);
|
||||||
cobj->owt = weight(cobj);
|
cobj->owt = weight(cobj);
|
||||||
} else {
|
} else {
|
||||||
obj_extract_self(otmp);
|
obj_extract_self(otmp);
|
||||||
@@ -2324,11 +2324,11 @@ struct mkroom *croom;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(o->containment & SP_OBJ_CONTENT)) {
|
||||||
stackobj(otmp);
|
stackobj(otmp);
|
||||||
|
|
||||||
if (o->lit) {
|
if (o->lit)
|
||||||
begin_burn(otmp, FALSE);
|
begin_burn(otmp, FALSE);
|
||||||
}
|
|
||||||
|
|
||||||
if (o->buried) {
|
if (o->buried) {
|
||||||
boolean dealloced;
|
boolean dealloced;
|
||||||
@@ -2339,6 +2339,7 @@ struct mkroom *croom;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create an altar in a room.
|
* Create an altar in a room.
|
||||||
|
|||||||
Reference in New Issue
Block a user