Hello! 

I did some fuzz testing a while ago, just updated and recompiled, only the following crashes still reproduces. 

[file.zip](https://github.com/LibreDWG/libredwg/files/10422616/file.zip)

This is the output with ASAN enabled:

```
./dwgread file.dwg
=================================================================
==24832==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f0eb89fec16 at pc 0x7f0eb9a525a4 bp 0x7ffe5ec5a870 sp 0x7ffe5ec5a868
WRITE of size 8 at 0x7f0eb89fec16 thread T0
    #0 0x7f0eb9a525a3 in copy_bytes /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:229:12
    #1 0x7f0eb9a525a3 in decompress_r2007 /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:569:11
    #2 0x7f0eb9a54734 in read_data_page /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:754:13
    #3 0x7f0eb9a54734 in read_data_section /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:843:19
    #4 0x7f0eb9a42c11 in read_2007_section_handles /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:1673:11
    #5 0x7f0eb9a42c11 in read_r2007_meta_data /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:2430:12
    #6 0x7f0eb97e841e in decode_R2007 /home/fmunozs/fuzz/libredwg/src/decode.c:3339:11
    #7 0x7f0eb97d30ae in dwg_decode /home/fmunozs/fuzz/libredwg/src/decode.c:223:29
    #8 0x7f0eb9a559cb in dwg_read_file /home/fmunozs/fuzz/libredwg/src/dwg.c:255:11
    #9 0x56365ef23e8a in main /home/fmunozs/fuzz/libredwg/programs/dwgread.c
    #10 0x7f0eb92e128f  (/usr/lib/libc.so.6+0x2328f) (BuildId: 1e94beb079e278ac4f2c8bce1f53091548ea1584)
    #11 0x7f0eb92e1349 in __libc_start_main (/usr/lib/libc.so.6+0x23349) (BuildId: 1e94beb079e278ac4f2c8bce1f53091548ea1584)
    #12 0x56365ee2a224 in _start /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115

0x7f0eb89fec16 is located 1 bytes to the right of 631829-byte region [0x7f0eb8964800,0x7f0eb89fec15)
allocated by thread T0 here:
    #0 0x56365eedf451 in __interceptor_calloc (/home/fmunozs/fuzz/libredwg/dwgread+0xd8451) (BuildId: c1abb9f7e8ee3d6153ceee2eee78fd254e67b4dc)
    #1 0x7f0eb9a53e32 in read_data_section /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:799:26

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:229:12 in copy_bytes
Shadow bytes around the buggy address:
  0x0fe257137d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe257137d80: 00 00[05]fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==24832==ABORTING

```

AddressSanitizer: heap-buffer-overflow in copy_bytes libredwg/src/decode_r2007.c:229:12
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : AddressSanitizer: heap-buffer-overflow in copy_bytes libredwg/src/decode_r2007.c:229:12
Issue date:

--- start body ---
Hello! 

I did some fuzz testing a while ago, just updated and recompiled, only the following crashes still reproduces. 

[file.zip](https://github.com/LibreDWG/libredwg/files/10422616/file.zip)

This is the output with ASAN enabled:

```
./dwgread file.dwg
=================================================================
==24832==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f0eb89fec16 at pc 0x7f0eb9a525a4 bp 0x7ffe5ec5a870 sp 0x7ffe5ec5a868
WRITE of size 8 at 0x7f0eb89fec16 thread T0
    #0 0x7f0eb9a525a3 in copy_bytes /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:229:12
    #1 0x7f0eb9a525a3 in decompress_r2007 /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:569:11
    #2 0x7f0eb9a54734 in read_data_page /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:754:13
    #3 0x7f0eb9a54734 in read_data_section /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:843:19
    #4 0x7f0eb9a42c11 in read_2007_section_handles /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:1673:11
    #5 0x7f0eb9a42c11 in read_r2007_meta_data /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:2430:12
    #6 0x7f0eb97e841e in decode_R2007 /home/fmunozs/fuzz/libredwg/src/decode.c:3339:11
    #7 0x7f0eb97d30ae in dwg_decode /home/fmunozs/fuzz/libredwg/src/decode.c:223:29
    #8 0x7f0eb9a559cb in dwg_read_file /home/fmunozs/fuzz/libredwg/src/dwg.c:255:11
    #9 0x56365ef23e8a in main /home/fmunozs/fuzz/libredwg/programs/dwgread.c
    #10 0x7f0eb92e128f  (/usr/lib/libc.so.6+0x2328f) (BuildId: 1e94beb079e278ac4f2c8bce1f53091548ea1584)
    #11 0x7f0eb92e1349 in __libc_start_main (/usr/lib/libc.so.6+0x23349) (BuildId: 1e94beb079e278ac4f2c8bce1f53091548ea1584)
    #12 0x56365ee2a224 in _start /build/glibc/src/glibc/csu/../sysdeps/x86_64/start.S:115

0x7f0eb89fec16 is located 1 bytes to the right of 631829-byte region [0x7f0eb8964800,0x7f0eb89fec15)
allocated by thread T0 here:
    #0 0x56365eedf451 in __interceptor_calloc (/home/fmunozs/fuzz/libredwg/dwgread+0xd8451) (BuildId: c1abb9f7e8ee3d6153ceee2eee78fd254e67b4dc)
    #1 0x7f0eb9a53e32 in read_data_section /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:799:26

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fmunozs/fuzz/libredwg/src/decode_r2007.c:229:12 in copy_bytes
Shadow bytes around the buggy address:
  0x0fe257137d30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe257137d70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe257137d80: 00 00[05]fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe257137dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==24832==ABORTING

```

--- end body ---
