## Affected version 

the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4

## What's the problem?

A null pointer deference was discovered in function add_PERSUBENTMGR in in_dxf.c.

ASAN report:

```
==522252==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000001ad2631 bp 0x7fffffffbcd0 sp 0x7fffffffbc70 T0)
==522252==The signal is caused by a READ memory access.
==522252==Hint: address points to the zero page.
    #0 0x1ad2631 in add_PERSUBENTMGR /src/libredwg/src/in_dxf.c:6123:26
    #1 0x1a8b6e9 in new_object /src/libredwg/src/in_dxf.c:9307:26
    #2 0x1a78816 in dxf_objects_read /src/libredwg/src/in_dxf.c:12301:22
    #3 0x1a6d0f9 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12838:23
    #4 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13
    #5 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15
    #6 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #7 0x41c40d in _start (/mnt/disk/out/libredwg/programs_asan/dxf2dwg+0x41c40d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /src/libredwg/src/in_dxf.c:6123:26 in add_PERSUBENTMGR
==522252==ABORTING
```


## Compile command

```
CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make
```

## How can we reproduce the issue?

```
unzip tests_64262.zip
dxf2dwg ./tests_64262 -o /dev/null
```
POC file :  
[tests_64262.zip](https://github.com/LibreDWG/libredwg/files/6635622/tests_64262.zip)

Null pointer dereference in function add_PERSUBENTMGR in in_dxf.c
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : Null pointer dereference in function add_PERSUBENTMGR in in_dxf.c
Issue date:

--- start body ---
## Affected version 

the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4

## What's the problem?

A null pointer deference was discovered in function add_PERSUBENTMGR in in_dxf.c.

ASAN report:

```
==522252==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000001ad2631 bp 0x7fffffffbcd0 sp 0x7fffffffbc70 T0)
==522252==The signal is caused by a READ memory access.
==522252==Hint: address points to the zero page.
    #0 0x1ad2631 in add_PERSUBENTMGR /src/libredwg/src/in_dxf.c:6123:26
    #1 0x1a8b6e9 in new_object /src/libredwg/src/in_dxf.c:9307:26
    #2 0x1a78816 in dxf_objects_read /src/libredwg/src/in_dxf.c:12301:22
    #3 0x1a6d0f9 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12838:23
    #4 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13
    #5 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15
    #6 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #7 0x41c40d in _start (/mnt/disk/out/libredwg/programs_asan/dxf2dwg+0x41c40d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /src/libredwg/src/in_dxf.c:6123:26 in add_PERSUBENTMGR
==522252==ABORTING
```


## Compile command

```
CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make
```

## How can we reproduce the issue?

```
unzip tests_64262.zip
dxf2dwg ./tests_64262 -o /dev/null
```
POC file :  
[tests_64262.zip](https://github.com/LibreDWG/libredwg/files/6635622/tests_64262.zip)

--- end body ---
