Skip to content

Commit 62dccdf

Browse files
committed
Fix vuln OSV-2023-1267
1 parent 47a07e5 commit 62dccdf

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/free.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,8 @@ free_preR13_object (Dwg_Object *obj)
682682
{
683683
Dwg_Object_Entity *_obj = obj->tio.entity;
684684
FIELD_HANDLE (layer, 2, 8);
685+
if (_obj->layer == NULL || !_obj->layer->handleref.is_global)
686+
return;
685687
if (_obj->flag_r11 & FLAG_R11_HAS_LTYPE) // 2
686688
FIELD_HANDLE (ltype, 1, 6);
687689
if (_obj->flag_r11 & FLAG_R11_HAS_HANDLING)

src/in_json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,6 +3170,7 @@ json_OBJECTS (Bit_Chain *restrict dat, Dwg_Data *restrict dwg,
31703170
objsize);
31713171
obj->tio.object = (Dwg_Object_Object *)calloc (
31723172
1, sizeof (Dwg_Object_Object));
3173+
obj->tio.entity = (Dwg_Object_Entity *)calloc(1, sizeof(Dwg_Object_Entity));
31733174
obj->tio.object->dwg = dwg;
31743175
obj->tio.object->objid = i;
31753176
// NEW_OBJECT (dwg, obj)

0 commit comments

Comments
 (0)