
[dwg_decode_POLYLINE_2D_private.zip](https://github.com/LibreDWG/libredwg/files/11304278/dwg_decode_POLYLINE_2D_private.zip)


```
user@debian:~/libredwg$ valgrind ./dwgread  dwg_decode_POLYLINE_2D_private.dwg
==10493== Memcheck, a memory error detector
==10493== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10493== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==10493== Command: ./dwgread dwg_decode_POLYLINE_2D_private.dwg
==10493==
==10493== Invalid write of size 4
==10493==    at 0x42DDB14: dwg_decode_POLYLINE_2D_private (dwg.spec:0)
==10493==    by 0x42C09C7: dwg_decode_POLYLINE_2D (dwg.spec:0)
==10493==    by 0x42BDC9E: dwg_decode_add_object (decode.c:5252)
==10493==    by 0x428015D: read_2004_section_handles (decode.c:2541)
==10493==    by 0x428015D: decode_R2004 (decode.c:3426)
==10493==    by 0x427BE40: dwg_decode (decode.c:0)
==10493==    by 0x439018F: dwg_read_file (dwg.c:261)
==10493==    by 0x804ACDA: main (dwgread.c:0)
==10493==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==10493==
==10493==
==10493== Process terminating with default action of signal 11 (SIGSEGV)
==10493==  Access not within mapped region at address 0x0
==10493==    at 0x42DDB14: dwg_decode_POLYLINE_2D_private (dwg.spec:0)
==10493==    by 0x42C09C7: dwg_decode_POLYLINE_2D (dwg.spec:0)
==10493==    by 0x42BDC9E: dwg_decode_add_object (decode.c:5252)
==10493==    by 0x428015D: read_2004_section_handles (decode.c:2541)
==10493==    by 0x428015D: decode_R2004 (decode.c:3426)
==10493==    by 0x427BE40: dwg_decode (decode.c:0)
==10493==    by 0x439018F: dwg_read_file (dwg.c:261)
==10493==    by 0x804ACDA: main (dwgread.c:0)
==10493==  If you believe this happened as a result of a stack
==10493==  overflow in your program's main thread (unlikely but
==10493==  possible), you can try to increase the size of the
==10493==  main thread stack using the --main-stacksize= flag.
==10493==  The main thread stack size used in this run was 8388608.
==10493==
==10493== HEAP SUMMARY:
==10493==     in use at exit: 6,600,247 bytes in 59,109 blocks
==10493==   total heap usage: 66,513 allocs, 7,404 frees, 16,519,170 bytes allocated
==10493==
==10493== LEAK SUMMARY:
==10493==    definitely lost: 0 bytes in 0 blocks
==10493==    indirectly lost: 0 bytes in 0 blocks
==10493==      possibly lost: 0 bytes in 0 blocks
==10493==    still reachable: 6,600,247 bytes in 59,109 blocks
==10493==         suppressed: 0 bytes in 0 blocks
==10493== Rerun with --leak-check=full to see details of leaked memory
==10493==
==10493== For lists of detected and suppressed errors, rerun with: -s
==10493== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault
```
Invalid write of size 4 dwg_decode_POLYLINE_2D_private 
This is a GitHub Issue
repo:libredwg
owner:LibreDWG
Title : Invalid write of size 4 dwg_decode_POLYLINE_2D_private 
Issue date:

--- start body ---

[dwg_decode_POLYLINE_2D_private.zip](https://github.com/LibreDWG/libredwg/files/11304278/dwg_decode_POLYLINE_2D_private.zip)


```
user@debian:~/libredwg$ valgrind ./dwgread  dwg_decode_POLYLINE_2D_private.dwg
==10493== Memcheck, a memory error detector
==10493== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10493== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==10493== Command: ./dwgread dwg_decode_POLYLINE_2D_private.dwg
==10493==
==10493== Invalid write of size 4
==10493==    at 0x42DDB14: dwg_decode_POLYLINE_2D_private (dwg.spec:0)
==10493==    by 0x42C09C7: dwg_decode_POLYLINE_2D (dwg.spec:0)
==10493==    by 0x42BDC9E: dwg_decode_add_object (decode.c:5252)
==10493==    by 0x428015D: read_2004_section_handles (decode.c:2541)
==10493==    by 0x428015D: decode_R2004 (decode.c:3426)
==10493==    by 0x427BE40: dwg_decode (decode.c:0)
==10493==    by 0x439018F: dwg_read_file (dwg.c:261)
==10493==    by 0x804ACDA: main (dwgread.c:0)
==10493==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==10493==
==10493==
==10493== Process terminating with default action of signal 11 (SIGSEGV)
==10493==  Access not within mapped region at address 0x0
==10493==    at 0x42DDB14: dwg_decode_POLYLINE_2D_private (dwg.spec:0)
==10493==    by 0x42C09C7: dwg_decode_POLYLINE_2D (dwg.spec:0)
==10493==    by 0x42BDC9E: dwg_decode_add_object (decode.c:5252)
==10493==    by 0x428015D: read_2004_section_handles (decode.c:2541)
==10493==    by 0x428015D: decode_R2004 (decode.c:3426)
==10493==    by 0x427BE40: dwg_decode (decode.c:0)
==10493==    by 0x439018F: dwg_read_file (dwg.c:261)
==10493==    by 0x804ACDA: main (dwgread.c:0)
==10493==  If you believe this happened as a result of a stack
==10493==  overflow in your program's main thread (unlikely but
==10493==  possible), you can try to increase the size of the
==10493==  main thread stack using the --main-stacksize= flag.
==10493==  The main thread stack size used in this run was 8388608.
==10493==
==10493== HEAP SUMMARY:
==10493==     in use at exit: 6,600,247 bytes in 59,109 blocks
==10493==   total heap usage: 66,513 allocs, 7,404 frees, 16,519,170 bytes allocated
==10493==
==10493== LEAK SUMMARY:
==10493==    definitely lost: 0 bytes in 0 blocks
==10493==    indirectly lost: 0 bytes in 0 blocks
==10493==      possibly lost: 0 bytes in 0 blocks
==10493==    still reachable: 6,600,247 bytes in 59,109 blocks
==10493==         suppressed: 0 bytes in 0 blocks
==10493== Rerun with --leak-check=full to see details of leaked memory
==10493==
==10493== For lists of detected and suppressed errors, rerun with: -s
==10493== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault
```
--- end body ---
