issue_owner_repo
listlengths
2
2
issue_body
stringlengths
0
261k
βŒ€
issue_title
stringlengths
1
925
issue_comments_url
stringlengths
56
81
issue_comments_count
int64
0
2.5k
issue_created_at
stringlengths
20
20
issue_updated_at
stringlengths
20
20
issue_html_url
stringlengths
37
62
issue_github_id
int64
387k
2.46B
issue_number
int64
1
127k
[ "LibreDWG", "libredwg" ]
### system info Ubuntu x86_64, clang 6.0, dwg2dxf([0.12.4.4608](https://github.com/LibreDWG/libredwg/releases/tag/0.12.4.4608)) ### Command line ./programs/dwg2dxf -b -m @@ -o /dev/null ### AddressSanitizer output ==8982==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x616000000592 at pc 0x0000005289e1 bp 0x7fffffffca80 sp 0x7fffffffca78 READ of size 1 at 0x616000000592 thread T0 #0 0x5289e0 in bit_calc_CRC /testcase/libredwg/src/bits.c:3257:29 #1 0x7059b1 in decode_preR13 /testcase/libredwg/src/decode_r11.c:760:14 #2 0x53245a in dwg_decode /testcase/libredwg/src/decode.c:209:23 #3 0x50d759 in dwg_read_file /testcase/libredwg/src/dwg.c:254:11 #4 0x50c454 in main /testcase/libredwg/programs/dwg2dxf.c:258:15 #5 0x7ffff6e22c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310 #6 0x419ee9 in _start (/testcase/libredwg/programs/dwg2dxf+0x419ee9) 0x616000000592 is located 0 bytes to the right of 530-byte region [0x616000000380,0x616000000592) allocated by thread T0 here: #0 0x4d2750 in calloc /fuzzer/build/llvm_tools/llvm-4.0.0.src/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:74 #1 0x50cdd0 in dat_read_file /testcase/libredwg/src/dwg.c:91:33 #2 0x50d708 in dwg_read_file /testcase/libredwg/src/dwg.c:247:15 #3 0x50c454 in main /testcase/libredwg/programs/dwg2dxf.c:258:15 #4 0x7ffff6e22c86 in __libc_start_main /build/glibc-CVJwZb/glibc-2.27/csu/../csu/libc-start.c:310 SUMMARY: AddressSanitizer: heap-buffer-overflow /testcase/libredwg/src/bits.c:3257:29 in bit_calc_CRC Shadow bytes around the buggy address: 0x0c2c7fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff8070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff80a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c2c7fff80b0: 00 00[02]fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff80d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff80e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff80f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff8100: 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 ==8982==ABORTING ### poc https://gitee.com/cxlzff/fuzz-poc/raw/master/libredwg/bit_calc_CRC_bof
heap-buffer-overflow exists in the function bit_calc_CRC in bits.c
https://api.github.com/repos/LibreDWG/libredwg/issues/484/comments
3
2022-06-07T01:21:33Z
2022-12-15T08:15:29Z
https://github.com/LibreDWG/libredwg/issues/484
1,262,604,647
484
[ "LibreDWG", "libredwg" ]
@rurban In the BLOCK_HEADER table entry is after name address of entity in block list. How could I process this address?
preR13 block table entry
https://api.github.com/repos/LibreDWG/libredwg/issues/483/comments
12
2022-06-02T00:07:01Z
2023-01-20T14:30:27Z
https://github.com/LibreDWG/libredwg/issues/483
1,257,337,123
483
[ "LibreDWG", "libredwg" ]
I think the GeoJSON export feature is barely usable at this moment. GeoJSON should follow WGS84/EPSG:4326 https://datatracker.ietf.org/doc/html/rfc7946. So, I think the workflow should be like: 1. Check if there is geo reference and coordinate system information in the dwg file first. If not, require user add it as a parameter. 2. Check the HEADER.Measurement for the units. 3. Convert all the coordinates into EPSG:4326 standard latitude and longitude. We may need https://proj.org/.
Expectation for dwgread to GeoJSON - EPSG:4326 standard
https://api.github.com/repos/LibreDWG/libredwg/issues/481/comments
1
2022-06-01T16:44:46Z
2022-06-02T04:21:07Z
https://github.com/LibreDWG/libredwg/issues/481
1,256,472,011
481
[ "LibreDWG", "libredwg" ]
I checked out the master branch and installed the required libs. After run "./configre", I got ``` config.status: error: Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See `config.log' for more details ``` config.log shows ``` gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:4000: $? = 1 configure:3989: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files configure:4500: checking whether make supports the include directive configure:4515: make -f confmf.GNU && cat confinc.out make β„Ή info Invoking all target node:internal/process/promises:279 triggerUncaughtException(err, true /* fromPromise */); ^ [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] { code: 'ERR_UNHANDLED_REJECTION' } Node.js v17.7.1 configure:4518: $? = 1 configure:4515: make -f confmf.BSD && cat confinc.out make β„Ή info Invoking all target node:internal/process/promises:279 triggerUncaughtException(err, true /* fromPromise */); ^ [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] { code: 'ERR_UNHANDLED_REJECTION' } Node.js v17.7.1 conftest.c: In function 'main': conftest.c:73:20: error: expected expression before ')' token 73 | if (sizeof ((_Bool))) | ``` Is there any special requirement about node.js?
failed to build on Ubuntu
https://api.github.com/repos/LibreDWG/libredwg/issues/479/comments
2
2022-05-31T17:28:22Z
2022-05-31T20:28:18Z
https://github.com/LibreDWG/libredwg/issues/479
1,254,174,516
479
[ "LibreDWG", "libredwg" ]
Hello everyone, I’m using the dxf2dwg program and converting does prints some errors and warning: ERROR: dwg_dynapi_entity_set_value: Invalid VPORT_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid LTYPE_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid LAYER_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid STYLE_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid VIEW_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid UCS_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid APPID_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid DIMSTYLE_CONTROL field objid ERROR: dwg_dynapi_entity_set_value: Invalid BLOCK_CONTROL field objid Warning: Unknown HEADER.DIMSTYLE STANDARD dxf:3 Warning: Unknown HEADER.CMLSTYLE STANDARD dxf:2 Warning: Unknown HEADER.DIMSTYLE STANDARD dxf:3 Warning: Object handle not found, 1/1 in 41156 objects Warning: Object handle not found, 12/C in 41156 objects The program successfully outputs to a DWG file. However, I got β€œDrawing file was created by an incompatible version” when opening it on Autodesk DWG Trueview 2022. Any clue? Thanks in advance
dxf2dwg file does not open with minimal DXF
https://api.github.com/repos/LibreDWG/libredwg/issues/474/comments
6
2022-05-14T09:04:57Z
2022-09-09T06:58:21Z
https://github.com/LibreDWG/libredwg/issues/474
1,235,921,273
474
[ "LibreDWG", "libredwg" ]
There is something wrong with entity parsing in work/preR13 branch. See example: [shape.tar.gz](https://github.com/LibreDWG/libredwg/files/8691343/shape.tar.gz) There are two entities: * LOAD * SHAPE Parse only first entity, because bad number "num" in src/decode.c - https://github.com/LibreDWG/libredwg/blob/09607bb52479d69356d07346e795fd98b7b867b9/src/decode.c#L5653 There is num = 8 on begin and then break in: ``` if (num + 1 >= dwg->header_vars.numentities) break; ``` so parse only first entity
Issue with entity parsing in pre2.10
https://api.github.com/repos/LibreDWG/libredwg/issues/471/comments
1
2022-05-13T21:11:42Z
2022-12-22T17:49:21Z
https://github.com/LibreDWG/libredwg/issues/471
1,235,718,772
471
[ "LibreDWG", "libredwg" ]
Hi @rurban, You are creating nice flags printing (https://github.com/LibreDWG/libredwg/commit/4a52199ea72b9a47ff21abc14f8b2485fdd101cd) Could we add this kind of logging to all flags?
Printing of flags
https://api.github.com/repos/LibreDWG/libredwg/issues/469/comments
3
2022-05-12T15:20:10Z
2023-01-03T09:25:57Z
https://github.com/LibreDWG/libredwg/issues/469
1,234,145,842
469
[ "LibreDWG", "libredwg" ]
@rurban All dimensions in preR13 are one entity, which has special flag inside which differentiate dimension types. Structure of dimension is: ``` flag_r11 entity_size layer_index opts_r11 (2 bytes, probably better is to use two flags) ... <------- elevation, thickness, handle, paper if flag_r11 flags block_index def_pt text_midpt flag1 <------ dimension type // Other is defined by opts_r11 flags ```
Parsing of preR13 dimensions
https://api.github.com/repos/LibreDWG/libredwg/issues/468/comments
11
2022-05-09T22:22:06Z
2022-12-30T09:49:13Z
https://github.com/LibreDWG/libredwg/issues/468
1,230,311,478
468
[ "LibreDWG", "libredwg" ]
I try to build LibreDWG for my Ubuntu 20 x86_64 using [instruction](https://wiki.freecadweb.org/FreeCAD_and_DWG_Import): git clone https://git.savannah.gnu.org/git/libredwg.git cd libredwg mkdir build cd build cmake .. make make install (or use checkinstall, or simply locate & copy the dwg2dxf utility to your executables path, it will be then autodetected by FreeCAD) But there is error during building: _[ 25%] Building C object CMakeFiles/redwg.dir/src/in_json.c.o /home/a/snap/freecad/common/libredwg/src/in_json.c:54:10: fatal error: ../jsmn/jsmn.h: No such file or directory 54 | #include "../jsmn/jsmn.h" | ^~~~~~~~~~~~~~~~ compilation terminated._ Looks like I forgot install some dependents on my system. But I want to say that it will be perfect if buildsystem checked which dependents are not is user's system now, istn't it?
LibreDWG build on Ubuntu 20
https://api.github.com/repos/LibreDWG/libredwg/issues/467/comments
6
2022-05-09T22:16:29Z
2022-12-22T05:16:27Z
https://github.com/LibreDWG/libredwg/issues/467
1,230,307,587
467
[ "LibreDWG", "libredwg" ]
when imported from json: ==222113==ERROR: LeakSanitizer: detected memory leaks ``` Direct leak of 13 byte(s) in 2 object(s) allocated from: #0 0x7f59a8b10648 in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cpp:439 #1 0x7f59a83e203c in json_OBJECTS ../../src/in_json.c:2857 #2 0x7f59a8404853 in dwg_read_json ../../src/in_json.c:4327 #3 0x55bbacd6d493 in main ../../programs/dxfwrite.c:331 #4 0x7f59a3db9d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 ``` and such. TODO in alive.text with asan
preR13 dxfwrite leaks
https://api.github.com/repos/LibreDWG/libredwg/issues/466/comments
0
2022-05-06T12:22:17Z
2023-01-16T08:38:13Z
https://github.com/LibreDWG/libredwg/issues/466
1,227,798,251
466
[ "LibreDWG", "libredwg" ]
Hi @rurban Many thanks for your hard work! I have some files where I run DWG read and the json produced is invalid, I can only assume DWGRead is throwing an exception and stopping. I'm using the latest windows binaries (0.12.4.4572) [DWGs.zip](https://github.com/LibreDWG/libredwg/files/8626760/DWGs.zip)
DWGRead Json Output not completing output
https://api.github.com/repos/LibreDWG/libredwg/issues/463/comments
1
2022-05-04T19:58:58Z
2022-05-04T20:03:31Z
https://github.com/LibreDWG/libredwg/issues/463
1,225,860,595
463
[ "LibreDWG", "libredwg" ]
Hi, I'm following README for installation and was getting stuck while `make` in the EC2 machine. I was able to successfully install it in my local machine though - ``` make all-recursive make[1]: Entering directory '/home/ubuntu/libredwg' Making all in src make[2]: Entering directory '/home/ubuntu/libredwg/src' (CDPATH="${ZSH_VERSION+.}:" && cd .. && /bin/bash /home/ubuntu/libredwg/build-aux/missing autoheader) rm -f stamp-h1 touch config.h.in cd .. && /bin/bash ./config.status src/config.h config.status: creating src/config.h config.status: src/config.h is unchanged make all-am make[3]: Entering directory '/home/ubuntu/libredwg/src' CC dwg.lo CC common.lo CC bits.lo CC decode.lo gcc: internal compiler error: Killed (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions. Makefile:648: recipe for target 'decode.lo' failed make[3]: *** [decode.lo] Error 1 make[3]: Leaving directory '/home/ubuntu/libredwg/src' Makefile:518: recipe for target 'all' failed make[2]: *** [all] Error 2 make[2]: Leaving directory '/home/ubuntu/libredwg/src' Makefile:672: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/home/ubuntu/libredwg' Makefile:555: recipe for target 'all' failed make: *** [all] Error 2 ``` Also, what is the correct way of installation for the production environment?
gcc-7: internal compiler error:
https://api.github.com/repos/LibreDWG/libredwg/issues/456/comments
9
2022-05-02T12:20:47Z
2022-12-30T09:50:14Z
https://github.com/LibreDWG/libredwg/issues/456
1,222,819,849
456
[ "LibreDWG", "libredwg" ]
Two variants: 1. json dump the tables, entities and blocks, as in the dwg/dxf. very simple and understandable, but needs special code for injson. 2. or create interim _CONTROL objects, holding the tables. best as r2004 arrays, not as r2000 doubly-linked lists. this would allow the old iteration via model_space -> block_control -> entities, as before. e.g. for dxf in/out, and all the helpers. we really need to add some diagrams to the docs also, how the iterators work.
pick a preR13 iterator/tables variant
https://api.github.com/repos/LibreDWG/libredwg/issues/453/comments
1
2022-04-27T07:01:24Z
2022-05-06T13:22:48Z
https://github.com/LibreDWG/libredwg/issues/453
1,216,891,010
453
[ "LibreDWG", "libredwg" ]
master branch (e.g. https://github.com/LibreDWG/libredwg/commit/59c0694f25bde5294869fc2a1be620f0abb768e4) ``` ./configure --disable-bindings --enable-write --enable-trace --disable-dxf --disable-json --disable-python --enable-debug make ``` Output: ``` ... /usr/bin/ld: ../src/.libs/libredwg.so: undefined reference to `in_postprocess_handles' /usr/bin/ld: ../src/.libs/libredwg.so: undefined reference to `dwg_encrypt_SAT1' /usr/bin/ld: ../src/.libs/libredwg.so: undefined reference to `in_postprocess_SEQEND' collect2: error: ld returned 1 exit status make[2]: *** [Makefile:716: dwgread] Chyba 1 make[2]: OpouΕ‘tΓ­ se adresΓ‘Ε™ β€ž/home/skim/44_git/libredwg/programsβ€œ make[1]: *** [Makefile:678: all-recursive] Chyba 1 make[1]: OpouΕ‘tΓ­ se adresΓ‘Ε™ β€ž/home/skim/44_git/libredwgβ€œ make: *** [Makefile:561: all] Chyba 2 ```
Compilation issue
https://api.github.com/repos/LibreDWG/libredwg/issues/449/comments
3
2022-04-26T16:03:26Z
2022-04-30T12:52:01Z
https://github.com/LibreDWG/libredwg/issues/449
1,216,174,625
449
[ "LibreDWG", "libredwg" ]
There are two same blocks for parsing of tables in preR13 src/decode.c e.g. BLOCK table: https://github.com/LibreDWG/libredwg/blob/master/src/decode.c#L389 ``` ... case SECTION_BLOCK: for (i = 0; i < tbl->number; i++) { PREP_TABLE (BLOCK_HEADER); FIELD_RC (flag, 70); FIELD_TFv (name, 32, 2); FIELD_RSd (used, 0); // -1 FIELD_RC (block_scaling, 0); FIELD_CAST (num_owned, RS, BL, 0); FIELD_RCd (flag2, 0); FIELD_CAST (num_inserts, RS, RL, 0); FIELD_RSd (insert_units, 0); CHK_ENDPOS; } break; ... ``` src/dwg.spec e.g. BLOCK table: https://github.com/LibreDWG/libredwg/blob/master/src/dwg.spec#L3066 ``` ... PRE (R_13) { FIELD_RC (flag, 70); FIELD_TFv (name, 32, 2); FIELD_RSd (used, 0); // -1 FIELD_RC (block_scaling, 0); FIELD_CAST (num_owned, RS, BL, 0); FIELD_RCd (flag2, 0); FIELD_CAST (num_inserts, RS, RL, 0); FIELD_RSd (insert_units, 0); FIELD_VALUE (anonymous) = FIELD_VALUE (flag) & 1; FIELD_VALUE (hasattrs) = FIELD_VALUE (flag) & 2; FIELD_VALUE (blkisxref) = FIELD_VALUE (flag) & 4; FIELD_VALUE (xrefoverlaid) = FIELD_VALUE (flag) & 8; } ... ``` I think we need to cleanup.
Duplicated parsing of tables in preR13
https://api.github.com/repos/LibreDWG/libredwg/issues/447/comments
3
2022-04-26T06:59:18Z
2022-04-30T11:06:17Z
https://github.com/LibreDWG/libredwg/issues/447
1,215,493,124
447
[ "LibreDWG", "libredwg" ]
The transformed SVG file by dwg2SVG.exe is not recognized by browser
SVG wrong viewbox
https://api.github.com/repos/LibreDWG/libredwg/issues/446/comments
8
2022-04-25T10:18:30Z
2023-02-10T07:11:57Z
https://github.com/LibreDWG/libredwg/issues/446
1,214,285,730
446
[ "LibreDWG", "libredwg" ]
There is issue in block table parsing in preR13 Example: [BLOCK1.DXF.gz](https://github.com/LibreDWG/libredwg/files/8549851/BLOCK1.DXF.gz) [BLOCK1.DWG.gz](https://github.com/LibreDWG/libredwg/files/8549852/BLOCK1.DWG.gz) Actual parsing: ``` ... blocks 0x46c (0xfffffb94) - 0x0 (0x48, 0x80000000) ... ``` and code in src/decode.c: ``` ... error |= decode_preR13_entities (blocks_start, blocks_end, blocks_start - blocks_offset, dat, dwg); ... ``` This doesn't work because blocks_end is 0. We need to use block_start + modified block_offset (& 0x00ffffff)
Issue with block table parsing in preR13
https://api.github.com/repos/LibreDWG/libredwg/issues/444/comments
7
2022-04-24T14:11:24Z
2023-01-16T08:41:34Z
https://github.com/LibreDWG/libredwg/issues/444
1,213,665,890
444
[ "LibreDWG", "libredwg" ]
``` D:\emsdk\libredwg\test\test-data\2018>dwg2dxf taihe.dwg taihe.dxf Reading DWG file taihe.dwg Warning: checksum: 0x32761371 (calculated) mismatch Warning: Invalid section_array_size: [8827].792575 != 8830 Warning: Invalid last_section_address: 18148ce != 1771280 Warning: section_map_id 8830 not found Warning: Add section_map_id [8828] 8830 => address 0x174a220 Warning: Repair invalid section_info_id [8827]: => 8829 Warning: Add section_info_id [8829] 8829 => address 0x101680152 ERROR: Invalid Data Section Page Map type 0x97f73a7f != 0x4163003b ERROR: Failed to decode file: taihe.dwg 0x100 READ ERROR 0x100 Usage: dwg2dxf [-v[N]] [--as rNNNN] [-m|--minimal] [-b|--binary] DWGFILES... D:\emsdk\libredwg\test\test-data\2018> ``` [taihe.zip](https://github.com/LibreDWG/libredwg/files/8536188/taihe.zip)
decode 2018 Section Page Map
https://api.github.com/repos/LibreDWG/libredwg/issues/439/comments
3
2022-04-22T01:36:10Z
2023-09-20T07:48:16Z
https://github.com/LibreDWG/libredwg/issues/439
1,211,714,277
439
[ "LibreDWG", "libredwg" ]
This magic AC402b string isn't R1.4 version. See links: https://www.cadforum.cz/en/qaID.asp?tip=868 http://devel.gvsig.org/sites/org.gvsig.dwg/2.0-SNAPSHOT/gvsig-base-library-pom/org.gvsig.dwg/xref/org/gvsig/dwg/lib/DwgFile.html
AC402b magic string
https://api.github.com/repos/LibreDWG/libredwg/issues/436/comments
2
2022-04-20T18:54:49Z
2022-04-22T09:23:01Z
https://github.com/LibreDWG/libredwg/issues/436
1,210,087,891
436
[ "LibreDWG", "libredwg" ]
We need to fix handling id in entity. Stub here: https://github.com/LibreDWG/libredwg/commit/2a92ef3dcd151ef65d09a3e00334abcd453846cd This is length and string without termination as i understang. Example: [POINT1.DXF.gz](https://github.com/LibreDWG/libredwg/files/8516065/POINT1.DXF.gz) [POINT1.DWG.gz](https://github.com/LibreDWG/libredwg/files/8516066/POINT1.DWG.gz)
Fix of handling if in entity
https://api.github.com/repos/LibreDWG/libredwg/issues/435/comments
6
2022-04-19T19:45:09Z
2023-01-06T12:26:28Z
https://github.com/LibreDWG/libredwg/issues/435
1,208,790,413
435
[ "LibreDWG", "libredwg" ]
These structure is 6x 3d point created by vpoint command from probably R_2_10 Example: vpoint 1,2,3 output structure: ``` -0.8944271909999159, 0.4472135954999579, 0.0 -0.3585685828003181, -0.7171371656006362, 0.5976143046671968 0.2672612419124244, 0.5345224838248488, 0.8017837257372732 -0.8944271909999159, -0.3585685828003181, 0.2672612419124244 0.4472135954999579, -0.7171371656006362, 0.5345224838248488 0.0, 0.5976143046671968, 0.8017837257372732 ``` From R_10 does't filled.
Identify structure of 3d points in pre13 (0x0252-0x02e0)
https://api.github.com/repos/LibreDWG/libredwg/issues/433/comments
1
2022-04-19T10:15:19Z
2022-12-30T09:52:06Z
https://github.com/LibreDWG/libredwg/issues/433
1,208,133,675
433
[ "LibreDWG", "libredwg" ]
Hello, I would like to use the library already compiled in Windows but when I enter the command dwg2SVG it returns empty svg output Could you help me please? ![image](https://user-images.githubusercontent.com/95845810/161934759-34cbe610-c479-4018-b96d-b03fa72f592f.png) ![image](https://user-images.githubusercontent.com/95845810/161934843-5d6ffb72-21f0-4e1f-87c6-b99718b8628f.png) ![image](https://user-images.githubusercontent.com/95845810/161934918-1c394503-f560-4b9e-abe4-919723dbc903.png)
dwg2SVG
https://api.github.com/repos/LibreDWG/libredwg/issues/429/comments
5
2022-04-06T08:47:39Z
2022-04-19T15:01:34Z
https://github.com/LibreDWG/libredwg/issues/429
1,194,282,710
429
[ "LibreDWG", "libredwg" ]
[fzw.zip](https://github.com/LibreDWG/libredwg/files/8401598/fzw.zip) [fzw_pu.zip](https://github.com/LibreDWG/libredwg/files/8401627/fzw_pu.zip) This file will not be garbled after ACAD PU.
Text garbled, wrong M+5xxxx decoding with ANSI_936
https://api.github.com/repos/LibreDWG/libredwg/issues/428/comments
3
2022-04-02T02:10:51Z
2023-08-13T11:43:59Z
https://github.com/LibreDWG/libredwg/issues/428
1,190,463,785
428
[ "LibreDWG", "libredwg" ]
Good way is create script files (*.scr and script command in autocad), which could be used for generation of DWG/DXF files. I could prepare some DWG files. But i don't understand testing system for it. @rurban could you help me with it?
How to test pre12 DWG files?
https://api.github.com/repos/LibreDWG/libredwg/issues/427/comments
11
2022-04-01T19:37:57Z
2022-05-05T06:35:39Z
https://github.com/LibreDWG/libredwg/issues/427
1,190,200,088
427
[ "LibreDWG", "libredwg" ]
10 | Control points (in WCS); one entry per control pointDXF:Β XΒ value; APP: 3D point
[Missing] test/2018/spline.dwg Missing control point information
https://api.github.com/repos/LibreDWG/libredwg/issues/426/comments
1
2022-03-29T06:48:35Z
2023-01-26T09:19:22Z
https://github.com/LibreDWG/libredwg/issues/426
1,184,388,659
426
[ "LibreDWG", "libredwg" ]
Hey there! I belong to an open source security research community, and a member (@peacock-doris) has found an issue, but doesn’t know the best way to disclose it. If not a hassle, might you kindly add a `SECURITY.md` file with an email, or another contact method? GitHub [recommends](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository) this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future. Thank you for your consideration, and I look forward to hearing from you! (cc @huntr-helper)
Potential security issue
https://api.github.com/repos/LibreDWG/libredwg/issues/425/comments
6
2022-03-23T09:29:23Z
2022-04-14T18:56:46Z
https://github.com/LibreDWG/libredwg/issues/425
1,177,847,095
425
[ "LibreDWG", "libredwg" ]
Hi, i have a little question - how disable logging info in console? I have reading [that post](https://github.com/LibreDWG/libredwg/issues/25#issuecomment-399935076), but couldn't understood what need did. I work in MS VS's environmental* ![image](https://user-images.githubusercontent.com/55656376/156940777-bd3bd241-f27a-4325-bd2f-74f8054099ee.png) P.S. Or may be with variable "DWG_LOGLEVEL" ... how it use? `#define DWG_LOGLEVEL DWG_LOGLEVEL_ERROR` not working ... log there is anyway
Disable logging a lot of info in console
https://api.github.com/repos/LibreDWG/libredwg/issues/424/comments
2
2022-03-06T20:24:39Z
2022-03-10T07:04:26Z
https://github.com/LibreDWG/libredwg/issues/424
1,160,706,785
424
[ "LibreDWG", "libredwg" ]
MinGW links the MSVC CRT rather than glibc, thus memmem() is not available. It appears that an alternative is already provided in src/common.h, but this is never used when building through CMake as cmakeconfig.h.in #defines HAVE_MEMMEM as 1 in all cases. CMake has a utility which easily resolves this issue: In CMakeLists.txt: ``` include(CheckSymbolExists) check_symbol_exists("memmem" "string.h" HAVE_MEMMEM) ``` In cmakeconfig.h.in: ``` /* Define if you have the `memmem' function. */ #cmakedefine HAVE_MEMMEM ```
CMake build issue: MinGW does not support memmem()
https://api.github.com/repos/LibreDWG/libredwg/issues/422/comments
2
2022-03-02T22:08:56Z
2022-03-04T08:07:42Z
https://github.com/LibreDWG/libredwg/issues/422
1,157,744,002
422
[ "LibreDWG", "libredwg" ]
cmakeconfig.h.in defines ENABLE_SHARED as follows: `#define ENABLE_SHARED @BUILD_SHARED_LIBS@` And uses it in common.h as follows: ``` #ifndef EXPORT # if defined(_WIN32) && defined(ENABLE_SHARED) ``` There are two bugs causing this not to work correctly with CMake: 1) The CMake functions which define BUILD_SHARED_LIBS happen _after_ config.h has been generated. This is only an issue if the parent CMake script did not explicitly set this variable. 2) If any part of the CMake script decides to set BUILD_SHARED_LIBS to OFF, config.h will then contain the following #define: `#define ENABLE_SHARED OFF` This causes the defined(ENABLE_SHARED) check to pass, rather than fail. The following solution seems to resolve the issue: 1) In cmakeconfig.h.in, use `#cmakedefine ENABLE_SHARED` in place of `#define ENABLE_SHARED @BUILD_SHARED_LIBS@` 2) Reorder CMakeLists.txt such that the lines controlling BUILD_SHARED_LIBS are executed before the lines generating config.h
BUILD_SHARED_LIBS not respected on WIN32
https://api.github.com/repos/LibreDWG/libredwg/issues/421/comments
0
2022-03-02T21:52:13Z
2022-03-04T08:07:42Z
https://github.com/LibreDWG/libredwg/issues/421
1,157,731,268
421
[ "LibreDWG", "libredwg" ]
In cmakeconfig.h.in, it appears that the HAVE_ALLOCA_H and HAVE_LIBGEN_H symbols are hardcoded to 1, regardless of the results of the CHECK_INCLUDE_FILE() calls in CMakeLists.txt. This causes compilation to fail under MinGW which does not provide the alloca.h header. Changing: #define HAVE_ALLOCA_H 1 #define HAVE_LIBGEN_H 1 To: #cmakedefine HAVE_ALLOCA_H #cmakedefine HAVE_LIBGEN_H Resolves this issue.
HAVE_ALLOCA_H and HAVE_LIBGEN_H symbols ignore results of cmake configure
https://api.github.com/repos/LibreDWG/libredwg/issues/420/comments
1
2022-03-02T19:16:33Z
2022-03-04T08:07:41Z
https://github.com/LibreDWG/libredwg/issues/420
1,157,590,003
420
[ "LibreDWG", "libredwg" ]
- Error messages: ```console [ 26%] Building C object CMakeFiles/redwg.dir/src/print.c.o /usr/local/bin/cc -Dredwg_EXPORTS -I....../libredwg/build/src -I....../libredwg/src -I....../libredwg/include -DLTO -O3 -DNDEBUG -fPIC -MD -MT CMakeFiles/redwg.dir/src/in_dxf.c.o -MF CMakeFiles/redwg.dir/src/in_dxf.c.o.d -o CMakeFiles/redwg.dir/src/in_dxf.c.o -c ....../libredwg/src/in_dxf.c /usr/local/bin/cc -Dredwg_EXPORTS -I....../libredwg/build/src -I....../libredwg/src -I....../libredwg/include -DLTO -O3 -DNDEBUG -fPIC -MD -MT CMakeFiles/redwg.dir/src/in_json.c.o -MF CMakeFiles/redwg.dir/src/in_json.c.o.d -o CMakeFiles/redwg.dir/src/in_json.c.o -c ....../libredwg/src/in_json.c /usr/local/bin/cc -Dredwg_EXPORTS -I....../libredwg/build/src -I....../libredwg/src -I....../libredwg/include -DLTO -O3 -DNDEBUG -fPIC -MD -MT CMakeFiles/redwg.dir/src/print.c.o -MF CMakeFiles/redwg.dir/src/print.c.o.d -o CMakeFiles/redwg.dir/src/print.c.o -c ....../libredwg/src/print.c ....../libredwg/src/bits.c: In function β€˜bit_strnlen’: ....../libredwg/src/bits.c:1797:13: warning: initialization discards β€˜const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 1797 | char *c = str; | ^~~ In file included from ....../libredwg/src/free.c:31: ....../libredwg/src/dwg.spec: In function β€˜dwg_free_LTYPE_private’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ In file included from ....../libredwg/src/print.c:26: ....../libredwg/src/dwg.spec: In function β€˜dwg_print_LTYPE’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ In file included from ....../libredwg/src/out_dxf.c:35: ....../libredwg/src/dwg.spec: In function β€˜dwg_dxf_LTYPE_private’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ In file included from ....../libredwg/src/out_json.c:29: ....../libredwg/src/dwg.spec: In function β€˜dwg_json_LTYPE_private’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ In file included from ....../libredwg/src/out_dxfb.c:27: ....../libredwg/src/dwg.spec: In function β€˜dwg_dxfb_LTYPE_private’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ In file included from ....../libredwg/src/encode.c:46: ....../libredwg/src/dwg.spec: In function β€˜dwg_encode_LTYPE_private’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ make[2]: *** [CMakeFiles/redwg.dir/build.make:233: CMakeFiles/redwg.dir/src/free.c.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from ....../libredwg/src/decode.c:37: ....../libredwg/src/dwg.spec: In function β€˜dwg_decode_LTYPE_private’: ....../libredwg/src/bits.h:280:18: error: β€˜str’ undeclared (first use in this function) 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:18: note: each undeclared identifier is reported only once for each function it appears in 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:23: error: β€˜maxlen’ undeclared (first use in this function); did you mean β€˜mbrlen’? 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ ....../libredwg/src/bits.h:280:31: error: expected β€˜;’ before β€˜bit_strnlen’ 280 | #define strnlen (str, maxlen) bit_strnlen(str, maxlen) | ^~~~~~~~~~~ ....../libredwg/src/dwg.spec:3208:27: note: in expansion of macro β€˜strnlen’ 3208 | dash_i += strnlen (_obj->dashes[rcount1].text, 256 - dash_i) + 1; | ^~~~~~~ make[2]: *** [CMakeFiles/redwg.dir/build.make:359: CMakeFiles/redwg.dir/src/print.c.o] Error 1 make[2]: *** [CMakeFiles/redwg.dir/build.make:247: CMakeFiles/redwg.dir/src/out_dxf.c.o] Error 1 make[2]: *** [CMakeFiles/redwg.dir/build.make:261: CMakeFiles/redwg.dir/src/out_json.c.o] Error 1 make[2]: *** [CMakeFiles/redwg.dir/build.make:289: CMakeFiles/redwg.dir/src/out_dxfb.c.o] Error 1 make[2]: *** [CMakeFiles/redwg.dir/build.make:135: CMakeFiles/redwg.dir/src/decode.c.o] Error 1 make[2]: *** [CMakeFiles/redwg.dir/build.make:303: CMakeFiles/redwg.dir/src/encode.c.o] Error 1 make[2]: Leaving directory '....../libredwg/build' make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/redwg.dir/all] Error 2 make[1]: Leaving directory '....../libredwg/build' make: *** [Makefile:149: all] Error 2 ``` - Error from Line 280 of file [https://github.com/LibreDWG/libredwg/blob/master/src/bits.h](https://github.com/LibreDWG/libredwg/blob/master/src/bits.h) . ```c++ #define strnlen (str, maxlen) bit_strnlen(str, maxlen) ``` Cheers
error: β€˜str’ undeclared (first use in this function)
https://api.github.com/repos/LibreDWG/libredwg/issues/418/comments
1
2022-02-26T10:00:20Z
2022-04-14T18:57:06Z
https://github.com/LibreDWG/libredwg/issues/418
1,151,586,963
418
[ "LibreDWG", "libredwg" ]
We have `unknown_12: 1 [RS 8]` actually and this is TEXTSTYLE index. See AC2.10 examples: * [BLANK.DWG.gz](https://github.com/LibreDWG/libredwg/files/8088649/BLANK.DWG.gz) `unknown_12: 0 [RS 8]` (default textstyle index) * [TS1.DWG.gz](https://github.com/LibreDWG/libredwg/files/8096654/TS1.DWG.gz) `unknown_12: 1 [RS 8]` (FOO textstyle on index 1) * [TS1.DXF.gz](https://github.com/LibreDWG/libredwg/files/8096658/TS1.DXF.gz) DXF output from r2.17 I don't know how to implement this change, because there is `BITCODE_H TEXTSTYLE; /*!< code 5, DXF 7 */` in include/dwg.h
TEXTSTYLE in AC1.50 .. AC1009
https://api.github.com/repos/LibreDWG/libredwg/issues/414/comments
2
2022-02-18T11:21:49Z
2022-04-15T06:42:47Z
https://github.com/LibreDWG/libredwg/issues/414
1,142,875,790
414
[ "LibreDWG", "libredwg" ]
Example: [BLANK.DWG.gz](https://github.com/LibreDWG/libredwg/files/8088649/BLANK.DWG.gz) Actual dump: ``` entities 0x2e5 - 0x2e5 blocks 0x447 (0x0) - 0x0 (0x80000000) ptr table BLOCK [ 1]: size:37 nr:-2146500608 (0x2e5-0x822b02e5) ptr table LAYER [ 2]: size:37 nr:-2146500607 (0x2e5-0x822b030a) ptr table STYLE [ 3]: size:130 nr:-2146500607 (0x30a-0x79e038c) ptr table LTYPE [ 5]: size:187 nr:-2146500607 (0x38c-0x8af50447) ptr table VIEW [ 6]: size:91 nr:-2146500608 (0x447-0x85550447) ``` This is bad - second address is bad need to be 0x2e5 etc. Binary data are: `00 80 25 00` - in this case is only `25 00` When i am decoding i have somethig like this: ``` ... [.] entities_start = 741 [.] entities_end = 741 [.] blocks_start = 1095 [.] blocks_size = 0 [.] blocks_end = 0 [.] unknown4b = 00 00 [.] unknown4c = 00 80 [.] table_block_item_size = 37 [.] table_block_items = 0 [.] unknown4e = 0f 80 [.] table_block_begin = 741 [.] unknown4f = 00 00 [.] table_layer_item_size = 37 [.] table_layer_items = 1 [.] unknown4g = 0f 80 [.] table_layer_begin = 741 [.] unknown4h = 00 00 [.] table_style_item_size = 130 [.] table_style_items = 1 [.] unknown4i = 0f 80 [.] table_style_begin = 778 [.] unknown4j = 00 00 [.] table_linetype_item_size = 187 [.] table_linetype_items = 1 [.] unknown4k = 0f 80 [.] table_linetype_begin = 908 [.] unknown4l = 00 00 [.] table_view_item_size = 91 [.] table_view_items = 0 [.] unknown4m = 0f 80 [.] table_view_begin = 1095 ... ``` When you looking there are repeating `00 80`, `0f 80`. in some DWG versions are `00 80`, `07 80`, `08 80`, `09 80`, `0a 80` and `0b 80` (last between table_view_items and table_view_begin) In greater DWG version is probably backward compatible size parser or some different system. I tested patch: ``` @@ -265,8 +265,10 @@ decode_preR13_section_ptr (const char *restrict name, Dwg_Section_Type_r11 id, { Dwg_Section *tbl = &dwg->header.section[id]; tbl->size = bit_read_RS (dat); - tbl->number = bit_read_RL (dat); - tbl->address = bit_read_RL (dat); + tbl->number = bit_read_RS (dat); + dat->byte += 2; // ?? 80 + tbl->address = bit_read_RS (dat); + dat->byte += 2; // 00 00 || ff ff strncpy (tbl->name, name, 63); tbl->name [63] = '\0'; LOG_TRACE ("ptr table %-8s [%2d]: size:%-4u nr:%-2ld (0x%lx-0x%lx)\n", ``` but i don't think that is enough.
Issue with section item number
https://api.github.com/repos/LibreDWG/libredwg/issues/413/comments
2
2022-02-17T14:08:16Z
2022-04-16T05:16:34Z
https://github.com/LibreDWG/libredwg/issues/413
1,141,386,071
413
[ "LibreDWG", "libredwg" ]
in src/header.spec is section: ``` for (i = 0; i < 3; i++) { // 3, 5, 205 FIELD_RS (unknown_s[i], 0); } ``` Valid from AC1.50 to AC1009 I believe that this three values are numbers of ?, sections and header variables (idea, but i counted and seems that is). On this values depends header variables (that's true). 3: ? 5: Number of sections (BLOCK, LAYER, STYLE, LTYPE, VIEW) ">=74 AND <=205": Number of header variables (from insertion_base, i don't know if 3d point is one or three) In AC1.50 DWG files: 3, 5, 74; 3, 5, 83; In AC2.10 example (in [BLANK.DWG.gz](https://github.com/LibreDWG/libredwg/files/8088649/BLANK.DWG.gz)): 3, 5, 83 In AC1001 DWG files: 3, 5, 101 In AC1002 DWG files: 3, 5, 104; 3, 5, 114 In AC1003 DWG files: 3, 5, 120; 3, 5, 122 In AC1004 DWG files: 3, 5, 129 In AC1006 DWG files: 3, 5, 158; 3, 5, 160 In AC1009 DWG files: 3, 5, 204; 3, 5, 205
unknown_s[] fields in header
https://api.github.com/repos/LibreDWG/libredwg/issues/412/comments
10
2022-02-17T13:08:27Z
2022-04-14T20:54:23Z
https://github.com/LibreDWG/libredwg/issues/412
1,141,316,441
412
[ "LibreDWG", "libredwg" ]
This error is bad, because exists valid DWG files which are ok. Example file saved by me from AutoCAD 2.17 (AC2.10) [BLANK.DWG.gz](https://github.com/LibreDWG/libredwg/files/8088649/BLANK.DWG.gz)
Error "DWG too small" is bad
https://api.github.com/repos/LibreDWG/libredwg/issues/411/comments
2
2022-02-17T12:38:33Z
2022-04-14T20:04:19Z
https://github.com/LibreDWG/libredwg/issues/411
1,141,285,848
411
[ "LibreDWG", "libredwg" ]
OSMODE variable exists, but it's on bad place. Values: 0: none 1: endpoint 2: midpoint 4: center 8: node 16: quadrant 32: intersection 64: insertion 128: perpendicular 256: tangent 512: nearest
Issue with AC2.10-AC1009 OSMODE header variable place
https://api.github.com/repos/LibreDWG/libredwg/issues/409/comments
1
2022-02-17T10:11:23Z
2022-02-17T18:29:27Z
https://github.com/LibreDWG/libredwg/issues/409
1,141,132,383
409
[ "LibreDWG", "libredwg" ]
This variable is valid only for AC1006 and AC1009. For versions between AC1.50 and AC1004 is this value number of entities in drawing.
PLINEGEN variable in pre13 DWG versions
https://api.github.com/repos/LibreDWG/libredwg/issues/408/comments
1
2022-02-14T23:43:23Z
2022-02-17T18:29:42Z
https://github.com/LibreDWG/libredwg/issues/408
1,137,981,542
408
[ "LibreDWG", "libredwg" ]
It is uncommon for packages to directly put files into /usr/share; rather, they would place them in a subdirectory, e.g. /usr/share/libredwg. ``` examples/Makefile.in:dist_data_DATA = dwgadd.example load_dwg.py examples/Makefile.am:dist_data_DATA = dwgadd.example load_dwg.py ``` These two lines probably should be dist_pkgdata_DATA=...
Placement of load_dwg.py
https://api.github.com/repos/LibreDWG/libredwg/issues/406/comments
2
2022-02-14T00:15:58Z
2022-04-23T20:49:18Z
https://github.com/LibreDWG/libredwg/issues/406
1,136,559,896
406
[ "LibreDWG", "libredwg" ]
Version 0.12.5 release tarball fails to compile for me on Gentoo Linux: ``` make[2]: *** No rule to make target 'dwg2ps.1', needed by 'all-am'. Stop. make[2]: *** Waiting for unfinished jobs.... make[2]: Leaving directory '/var/tmp/portage/media-gfx/libredwg-0.12.5/work/libredwg-0.12.5/programs' make[1]: *** [Makefile:674: all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/media-gfx/libredwg-0.12.5/work/libredwg-0.12.5' make: *** [Makefile:557: all] Error 2 ``` Full build log: [build.log](https://github.com/LibreDWG/libredwg/files/8040242/build.log) On the other hand, cloning the git repo and compiling that works.
0.12.5: No rule to make target 'dwg2ps.1', needed by 'all-am'. Stop.
https://api.github.com/repos/LibreDWG/libredwg/issues/404/comments
8
2022-02-10T10:50:36Z
2022-04-23T20:49:42Z
https://github.com/LibreDWG/libredwg/issues/404
1,129,825,850
404
[ "LibreDWG", "libredwg" ]
Hi @rurban after installing how do i configure this package for python on windows? i built the package ...but how can i use it as python package ..how to import libredwg as said in examples.. ``` "C:\Python310\DLLs\LibreDWG.py", line 15, in <module> import _LibreDWG ModuleNotFoundError: No module named '_LibreDWG' ``` ``` Traceback (most recent call last): File "LibreDWG.py", line 14, in swig_import_helper return importlib.import_module(mname) File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 658, in _load_unlocked File "<frozen importlib._bootstrap>", line 571, in module_from_spec File "<frozen importlib._bootstrap_external>", line 922, in create_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed ImportError: /home/cs/Desktop/check/_LibreDWG.so: undefined symbol: dwg_getall_VX_CONTROL ``` i am getting this when i try for python 2.7 in Linux Thanks
Python interface
https://api.github.com/repos/LibreDWG/libredwg/issues/403/comments
1
2022-02-09T17:59:12Z
2023-02-10T07:08:59Z
https://github.com/LibreDWG/libredwg/issues/403
1,128,858,025
403
[ "LibreDWG", "libredwg" ]
I am just trying to run an executable file on windows 10. Can anyone tell me how to run the exe files in libredwg-0.12.4.4367-win64.zip. Do I need to install some other software to run the exe or download the source code too?
Running precompiled version 0.12.4.4367
https://api.github.com/repos/LibreDWG/libredwg/issues/398/comments
4
2022-01-21T04:18:22Z
2022-01-22T07:25:35Z
https://github.com/LibreDWG/libredwg/issues/398
1,110,038,051
398
[ "LibreDWG", "libredwg" ]
``` % ./dwgread --format json ~/Downloads/architectural_-_annotation_scaling_and_multileaders.dwg | python -m json.tool SUCCESS Expecting , delimiter: line 66654 column 7 (char 1686274) ``` This file can be downloaded here: https://knowledge.autodesk.com/support/autocad-lt/downloads/caas/downloads/content/autocad-lt-2010-sample-files.html I've seen this error on a couple of files.
Invalid json being generated
https://api.github.com/repos/LibreDWG/libredwg/issues/397/comments
1
2021-11-24T05:12:56Z
2022-02-04T19:11:29Z
https://github.com/LibreDWG/libredwg/issues/397
1,062,011,213
397
[ "LibreDWG", "libredwg" ]
I'm seeing a couple of the above messages when compiling on a Mac. Does it matter? ./dwg.spec:7449:9: warning: format specifies type 'unsigned short' but the argument has type 'BITCODE_BL' (aka 'unsigned int') [-Wformat]
./dwg.spec:1557:17: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
https://api.github.com/repos/LibreDWG/libredwg/issues/396/comments
4
2021-11-23T18:45:31Z
2022-02-04T22:05:18Z
https://github.com/LibreDWG/libredwg/issues/396
1,061,604,234
396
[ "LibreDWG", "libredwg" ]
I'm getting the following, in response to "make test" ``` make[3]: Leaving directory '/libredwg/bindings/python' make[3]: Entering directory '/libredwg/bindings' Making all for perl Making check for perl if grep "NOOP = rem" perl/Makefile; then false; else \ LD_LIBRARY_PATH="/libredwg/src/.libs" make -C perl test \ PERL="/usr/bin/perl" OPTIMIZE="-I/libredwg/include -I/libredwg/src" \ OTHERLDFLAGS="-L/libredwg/src/.libs"; fi make[4]: Entering directory '/libredwg/bindings/perl' /usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- LibreDWG.bs blib/arch/auto/LibreDWG/LibreDWG.bs 644 PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/0_basic.t .. 1/1 # Failed test 'use LibreDWG;' # at t/0_basic.t line 2. # Tried to use 'LibreDWG'. # Error: Can't load '/libredwg/bindings/perl/blib/arch/auto/LibreDWG/LibreDWG.so' for module LibreDWG: /libredwg/bindings/perl/blib/arch/auto/LibreDWG/LibreDWG.so: undefined symbol: dwg_setup_ENDBLK at /usr/lib/x86_64-linux-gnu/perl/5.30/DynaLoader.pm line 193. # at /libredwg/bindings/perl/blib/lib/LibreDWG.pm line 11. # Compilation failed in require at t/0_basic.t line 2. # BEGIN failed--compilation aborted at t/0_basic.t line 2. # Looks like you failed 1 test of 1. t/0_basic.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests Test Summary Report ------------------- t/0_basic.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 Files=1, Tests=1, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.16 cusr 0.02 csys = 0.20 CPU) Result: FAIL Failed 1/1 test programs. 1/1 subtests failed. make[4]: *** [Makefile:1000: test_dynamic] Error 1 make[4]: Leaving directory '/libredwg/bindings/perl' make[3]: [Makefile:789: check-am] Error 2 (ignored) make[3]: Leaving directory '/libredwg/bindings' ``` This is running in a docker ubuntu container. Complete setup was: ``` 1 apt update 2 apt install sudo # Just saves time when passing examples that use sudo 3 sudo apt-get install git autoconf libtool swig python-dev texinfo build-essential gcc 4 git clone git://git.sv.gnu.org/libredwg.git 5 cd libredwg/ 6 sh autogen.sh 7 sudo apt install python3.9 8 apt-get install python3.9-dev 9 make 10 sudo make install 11 make check ```
Make test failing: "undefined symbol: dwg_setup_ENDBLK"
https://api.github.com/repos/LibreDWG/libredwg/issues/395/comments
2
2021-10-08T19:25:49Z
2023-01-06T13:22:35Z
https://github.com/LibreDWG/libredwg/issues/395
1,021,401,062
395
[ "LibreDWG", "libredwg" ]
Hi, I have attached three files. one original DWG file and two dxf files one converted using libreDWG and other using online converter. The online converted file is having all information where as where as dxf file converted using libredwg is not having all information, some information are missing. Can you please fix it? [file to share.zip](https://github.com/LibreDWG/libredwg/files/7127936/file.to.share.zip)
dwg2dxf conversion is not converting all informations.
https://api.github.com/repos/LibreDWG/libredwg/issues/394/comments
7
2021-09-08T10:04:20Z
2023-08-03T15:12:53Z
https://github.com/LibreDWG/libredwg/issues/394
990,962,476
394
[ "LibreDWG", "libredwg" ]
Got an "TypeError: in method 'dwg_read_file', argument 1 of type 'char const *'" error while reading dwg that filename contains wide chars.
Python lib doesn't work with wide chars filename
https://api.github.com/repos/LibreDWG/libredwg/issues/393/comments
0
2021-09-01T05:02:58Z
2021-09-01T17:43:06Z
https://github.com/LibreDWG/libredwg/issues/393
984,622,048
393
[ "LibreDWG", "libredwg" ]
## Affected version the lastest version https://github.com/LibreDWG/libredwg/tree/0.12.4.4348 ## What's the problem? A heap-buffer-overflow was discovered in function copy_compressed_bytes in decode_r2007.c ASAN report: ``` ================================================================= ==4121331==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f434dfe4b02 at pc 0x557c1679dc89 bp 0x7ffd0d01ea80 sp 0x7ffd0d01ea70 WRITE of size 8 at 0x7f434dfe4b02 thread T0 #0 0x557c1679dc88 in copy_compressed_bytes /libredwg/src/decode_r2007.c:280 #1 0x557c167a305e in decompress_r2007 /libredwg/src/decode_r2007.c:523 #2 0x557c167a439f in read_data_page /libredwg/src/decode_r2007.c:730 #3 0x557c167a4f5d in read_data_section /libredwg/src/decode_r2007.c:820 #4 0x557c167af4b5 in read_2007_section_handles /libredwg/src/decode_r2007.c:1639 #5 0x557c167fdf3d in read_r2007_meta_data /libredwg/src/decode_r2007.c:2395 #6 0x557c15d5a4b1 in decode_R2007 /libredwg/src/decode.c:3843 #7 0x557c15c5eebb in dwg_decode /libredwg/src/decode.c:248 #8 0x557c15c353e2 in dwg_read_file /libredwg/src/dwg.c:254 #9 0x557c15c30af0 in main /libredwg/programs/dwg2SVG.c:975 #10 0x7f4350d350b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #11 0x557c15c27c0d in _start (/libredwg/fuzz/asan+0x209c0d) 0x7f434dfe4b02 is located 0 bytes to the right of 197378-byte region [0x7f434dfb4800,0x7f434dfe4b02) allocated by thread T0 here: #0 0x7f435115cdc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x557c167a46cc in read_data_section /libredwg/src/decode_r2007.c:776 #2 0x557c167af4b5 in read_2007_section_handles /libredwg/src/decode_r2007.c:1639 #3 0x557c167fdf3d in read_r2007_meta_data /libredwg/src/decode_r2007.c:2395 #4 0x557c15d5a4b1 in decode_R2007 /libredwg/src/decode.c:3843 #5 0x557c15c5eebb in dwg_decode /libredwg/src/decode.c:248 #6 0x557c15c353e2 in dwg_read_file /libredwg/src/dwg.c:254 #7 0x557c15c30af0 in main /libredwg/programs/dwg2SVG.c:975 #8 0x7f4350d350b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-buffer-overflow /libredwg/src/decode_r2007.c:280 in copy_compressed_bytes Shadow bytes around the buggy address: 0x0fe8e9bf4910: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe8e9bf4920: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe8e9bf4930: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe8e9bf4940: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe8e9bf4950: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0fe8e9bf4960:[02]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe8e9bf4970: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe8e9bf4980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe8e9bf4990: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe8e9bf49a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe8e9bf49b0: 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 Shadow gap: cc ==4121331==ABORTING ``` ## Compile command CC="afl-clang-lto" CFLAGS="-g -fsanitize=address" ./configure --enable-release --disable-shared && make ## How can we reproduce the issue? ./dwg2SVG [poc] POC file: [id_000001,sig_06,src_000028,time_3480455,op_flip1,pos_64226.zip](https://github.com/LibreDWG/libredwg/files/7075021/id_000001.sig_06.src_000028.time_3480455.op_flip1.pos_64226.zip)
A heap-buffer-overflow in function copy_compressed_bytes in decode_r2007.c
https://api.github.com/repos/LibreDWG/libredwg/issues/392/comments
0
2021-08-30T07:38:44Z
2022-02-04T22:10:31Z
https://github.com/LibreDWG/libredwg/issues/392
982,488,466
392
[ "LibreDWG", "libredwg" ]
## Affected version the lastest version https://github.com/LibreDWG/libredwg/tree/0.12.4.4348 ## What's the problem? A heap-buffer-overflow was discovered in function copy_bytes in decode_r2007.c ASAN report: ``` ================================================================= ==4110248==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f036a28ab02 at pc 0x55f47c191f4d bp 0x7ffe1452e290 sp 0x7ffe1452e280 WRITE of size 1 at 0x7f036a28ab02 thread T0 #0 0x55f47c191f4c in copy_bytes /libredwg/src/decode_r2007.c:228 #1 0x55f47c1984e0 in decompress_r2007 /libredwg/src/decode_r2007.c:550 #2 0x55f47c19939f in read_data_page /libredwg/src/decode_r2007.c:730 #3 0x55f47c199f5d in read_data_section /libredwg/src/decode_r2007.c:820 #4 0x55f47c1a44b5 in read_2007_section_handles /libredwg/src/decode_r2007.c:1639 #5 0x55f47c1f2f3d in read_r2007_meta_data /libredwg/src/decode_r2007.c:2395 #6 0x55f47b74f4b1 in decode_R2007 /libredwg/src/decode.c:3843 #7 0x55f47b653ebb in dwg_decode /libredwg/src/decode.c:248 #8 0x55f47b62a3e2 in dwg_read_file /libredwg/src/dwg.c:254 #9 0x55f47b625af0 in main /libredwg/programs/dwg2SVG.c:975 #10 0x7f036cedb0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #11 0x55f47b61cc0d in _start (/libredwg/fuzz/asan+0x209c0d) 0x7f036a28ab02 is located 0 bytes to the right of 197378-byte region [0x7f036a25a800,0x7f036a28ab02) allocated by thread T0 here: #0 0x7f036d302dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x55f47c1996cc in read_data_section /libredwg/src/decode_r2007.c:776 #2 0x55f47c1a44b5 in read_2007_section_handles /libredwg/src/decode_r2007.c:1639 #3 0x55f47c1f2f3d in read_r2007_meta_data /libredwg/src/decode_r2007.c:2395 #4 0x55f47b74f4b1 in decode_R2007 /libredwg/src/decode.c:3843 #5 0x55f47b653ebb in dwg_decode /libredwg/src/decode.c:248 #6 0x55f47b62a3e2 in dwg_read_file /libredwg/src/dwg.c:254 #7 0x55f47b625af0 in main /libredwg/programs/dwg2SVG.c:975 #8 0x7f036cedb0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-buffer-overflow /libredwg/src/decode_r2007.c:228 in copy_bytes Shadow bytes around the buggy address: 0x0fe0ed449510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe0ed449520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe0ed449530: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe0ed449540: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0fe0ed449550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0fe0ed449560:[02]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe0ed449570: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe0ed449580: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe0ed449590: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe0ed4495a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0fe0ed4495b0: 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 Shadow gap: cc ==4110248==ABORTING ``` ## Compile command CC="afl-clang-lto" CFLAGS="-g -fsanitize=address" ./configure --enable-release --disable-shared && make ## How can we reproduce the issue? ./dwg2SVG [poc] POC file: [id_000001,sig_06,src_007112,time_55136584,op_flip4,pos_64098.zip](https://github.com/LibreDWG/libredwg/files/7074994/id_000001.sig_06.src_007112.time_55136584.op_flip4.pos_64098.zip)
A heap-buffer-overflow in function copy_bytes in decode_r2007.c
https://api.github.com/repos/LibreDWG/libredwg/issues/391/comments
0
2021-08-30T07:31:07Z
2022-02-04T22:10:48Z
https://github.com/LibreDWG/libredwg/issues/391
982,483,372
391
[ "LibreDWG", "libredwg" ]
## Affected version the lastest version https://github.com/LibreDWG/libredwg/tree/0.12.4.4348 ## What's the problem? A null pointer deference was discovered in function output_SVG in dwg2SVG.c ASAN report: ``` <?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="basic" width="100%" height="100%" viewBox="-12.019621 -58.848308 37.409022 104.239317"> <defs> AddressSanitizer:DEADLYSIGNAL ================================================================= ==4105970==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x55ebc7a930f5 bp 0x7ffcd4596f20 sp 0x7ffcd4596ef0 T0) ==4105970==The signal is caused by a READ memory access. ==4105970==Hint: address points to the zero page. #0 0x55ebc7a930f4 in output_SVG /libredwg/programs/dwg2SVG.c:862 #1 0x55ebc7a93b59 in main /libredwg/programs/dwg2SVG.c:980 #2 0x7fcb3a58c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #3 0x55ebc7a8ac0d in _start (/libredwg/fuzz/asan+0x209c0d) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /libredwg/programs/dwg2SVG.c:862 in output_SVG ==4105970==ABORTING ``` ## Compile command CC="afl-clang-lto" CFLAGS="-g -fsanitize=address" ./configure --enable-release --disable-shared && make ## How can we reproduce the issue? ./dwg2SVG [poc] POC file: [id_000000,sig_11,src_010799,time_76993507,op_ext_AO,pos_1249.zip](https://github.com/LibreDWG/libredwg/files/7074864/id_000000.sig_11.src_010799.time_76993507.op_ext_AO.pos_1249.zip)
null pointer deference in function output_SVG in dwg2SVG.c
https://api.github.com/repos/LibreDWG/libredwg/issues/390/comments
1
2021-08-30T07:17:52Z
2022-02-05T10:52:09Z
https://github.com/LibreDWG/libredwg/issues/390
982,474,309
390
[ "LibreDWG", "libredwg" ]
How to explode the block reference by using the libredwg ?Just like the AutoCAD's command "explode", and get all of the entities in the block reference.
How to explode the Block Reference ?
https://api.github.com/repos/LibreDWG/libredwg/issues/389/comments
1
2021-07-22T01:32:20Z
2023-01-25T20:57:30Z
https://github.com/LibreDWG/libredwg/issues/389
950,227,449
389
[ "LibreDWG", "libredwg" ]
dwgadd is unusable: * Need of "\n" at begin of first string, sic. * issue with initial = 1 at begin and setting to intial after initialization * No error message to stderr in each exit(1) * Missing error in stderr in dwg_add_dat (&dwgp, &dat) != 0
Broken dwgadd
https://api.github.com/repos/LibreDWG/libredwg/issues/388/comments
6
2021-07-06T23:45:22Z
2023-02-02T11:56:29Z
https://github.com/LibreDWG/libredwg/issues/388
938,343,080
388
[ "LibreDWG", "libredwg" ]
Hi I have problems decoding these files. [err.zip](https://github.com/LibreDWG/libredwg/files/6676817/err.zip) Looks like handle ids and offsets get wrong values. I think MC and UMC can be 8 bytes here. Please verify. Thanks Artur
Errors decoding handles, wrong MC, UMC decoding
https://api.github.com/repos/LibreDWG/libredwg/issues/386/comments
2
2021-06-18T11:53:06Z
2023-04-22T09:26:28Z
https://github.com/LibreDWG/libredwg/issues/386
924,831,107
386
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in add_AcDbSectionViewStyle in in_dxf.c. ASAN report: ``` ==2476645==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x612000001318 at pc 0x000001b103bb bp 0x7fffffffbaf0 sp 0x7fffffffbae8 READ of size 4 at 0x612000001318 thread T0 #0 0x1b103ba in add_AcDbSectionViewStyle /src/libredwg/src/in_dxf.c:8097:10 #1 0x1a94fa9 in new_object /src/libredwg/src/in_dxf.c:10590:22 #2 0x1a7813c in dxf_entities_read /src/libredwg/src/in_dxf.c:12247:18 #3 0x1a6d0d2 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12830: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) 0x612000001318 is located 336 bytes to the right of 264-byte region [0x6120000010c0,0x6120000011c8) allocated by thread T0 here: #0 0x497eb2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x1aa180c in new_object /src/libredwg/src/./objects.inc:48:1 #2 0x1a7813c in dxf_entities_read /src/libredwg/src/in_dxf.c:12247:18 #3 0x1a6d0d2 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12830: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 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/in_dxf.c:8097:10 in add_AcDbSectionViewStyle Shadow bytes around the buggy address: 0x0c247fff8210: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fff8220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fff8230: 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa 0x0c247fff8240: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8250: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c247fff8260: fa fa fa[fa]fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8270: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff8290: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff82a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c247fff82b0: 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 Shadow gap: cc ==2476645==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64278.zip dxf2dwg ./tests_64278 -o /dev/null ``` POC file : [tests_64278.zip](https://github.com/LibreDWG/libredwg/files/6652823/tests_64278.zip)
Heap-buffer-overflow in add_AcDbSectionViewStyle in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/385/comments
0
2021-06-15T04:33:19Z
2021-06-24T15:51:27Z
https://github.com/LibreDWG/libredwg/issues/385
920,975,128
385
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in dwg_convert_SAB_to_SAT1 in out_dxf.c:2230. ASAN report: ``` ==3850==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x629000068200 at pc 0x00000043a150 bp 0x7fffffffc6e0 sp 0x7fffffffbe78 WRITE of size 22 at 0x629000068200 thread T0 #0 0x43a14f in vsprintf /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1670:1 #1 0x43b209 in __sprintf_chk /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1718:1 #2 0xe3f2cd in dwg_convert_SAB_to_SAT1 /src/libredwg/src/out_dxf.c:2230:17 #3 0xeebd9e in dxf_3dsolid /src/libredwg/src/out_dxf.c:2334:20 #4 0xeecb01 in dwg_dxf__3DSOLID_private /src/libredwg/src/./dwg.spec:2370:3 #5 0xea23e2 in dwg_dxf__3DSOLID /src/libredwg/src/./dwg.spec:2369:1 #6 0xe9677d in dwg_dxf_object /src/libredwg/src/out_dxf.c:2690:14 #7 0xe6817c in dxf_entities_write /src/libredwg/src/out_dxf.c:3532:16 #8 0xe41b4c in dwg_write_dxf /src/libredwg/src/out_dxf.c:3682:7 #9 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #10 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #11 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) 0x629000068200 is located 0 bytes to the right of 16384-byte region [0x629000064200,0x629000068200) allocated by thread T0 here: #0 0x496b43 in realloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3 #1 0x4d7d12 in bit_chain_alloc /src/libredwg/src/bits.c:3026:30 #2 0xe3f0ec in dwg_convert_SAB_to_SAT1 /src/libredwg/src/out_dxf.c:2196:15 #3 0xeebd9e in dxf_3dsolid /src/libredwg/src/out_dxf.c:2334:20 #4 0xeecb01 in dwg_dxf__3DSOLID_private /src/libredwg/src/./dwg.spec:2370:3 #5 0xea23e2 in dwg_dxf__3DSOLID /src/libredwg/src/./dwg.spec:2369:1 #6 0xe9677d in dwg_dxf_object /src/libredwg/src/out_dxf.c:2690:14 #7 0xe6817c in dxf_entities_write /src/libredwg/src/out_dxf.c:3532:16 #8 0xe41b4c in dwg_write_dxf /src/libredwg/src/out_dxf.c:3682:7 #9 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #10 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:1670:1 in vsprintf Shadow bytes around the buggy address: 0x0c5280004ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c5280005000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c5280005010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c5280005020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c5280005030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c5280005040:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5280005050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5280005060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5280005070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5280005080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c5280005090: 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 Shadow gap: cc ==3850==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64265.zip dxfwrite -I DWG -o /dev/null -y ./tests_64265 ``` POC file : [tests_64265.zip](https://github.com/LibreDWG/libredwg/files/6652592/tests_64265.zip)
Heap-buffer-overflow in dwg_convert_SAB_to_SAT1 in out_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/384/comments
0
2021-06-15T03:37:45Z
2021-06-24T15:50:15Z
https://github.com/LibreDWG/libredwg/issues/384
920,952,622
384
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A double free was discovered in dwg_free_LAYER_private in dwg.spec. ASAN report: ``` ==3639890==ERROR: AddressSanitizer: attempting double-free on 0x602000009c70 in thread T0: #0 0x497ab2 in free /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3 #1 0xd4b785 in dwg_free_LAYER_private /src/libredwg/src/./dwg.spec:2986:3 #2 0xcd4248 in dwg_free_LAYER /src/libredwg/src/./dwg.spec:2948:1 #3 0xd68ad9 in dwg_free_object /src/libredwg/src/free.c:759:7 #4 0xd69575 in dwg_free /src/libredwg/src/free.c:1265:13 #5 0x4c95e9 in main /src/libredwg/programs/dxf2dwg.c:412:11 #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) 0x602000009c70 is located 0 bytes inside of 2-byte region [0x602000009c70,0x602000009c72) freed by thread T0 here: #0 0x497ab2 in free /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3 #1 0xd4b74a in dwg_free_LAYER_private /src/libredwg/src/./dwg.spec:2986:3 #2 0xcd4248 in dwg_free_LAYER /src/libredwg/src/./dwg.spec:2948:1 #3 0xd68ad9 in dwg_free_object /src/libredwg/src/free.c:759:7 #4 0xd69575 in dwg_free /src/libredwg/src/free.c:1265:13 #5 0x4c95e9 in main /src/libredwg/programs/dxf2dwg.c:412:11 #6 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 previously allocated by thread T0 here: #0 0x483614 in strdup /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors.cpp:437:3 #1 0x1a92dd6 in new_object /src/libredwg/src/in_dxf.c:11750:44 #2 0x1a73b0a in dxf_tables_read /src/libredwg/src/in_dxf.c:11909:22 #3 0x1a6ce22 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12779: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 SUMMARY: AddressSanitizer: double-free /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3 in free ==3639890==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64266.zip dxf2dwg ./tests_64266 -o /dev/null ``` POC file : [tests_64266.zip](https://github.com/LibreDWG/libredwg/files/6652554/tests_64266.zip)
Double free in function dwg_free_LAYER_private dwg.spec
https://api.github.com/repos/LibreDWG/libredwg/issues/383/comments
0
2021-06-15T03:27:18Z
2022-02-05T12:48:29Z
https://github.com/LibreDWG/libredwg/issues/383
920,948,788
383
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in dxf_read_CMC in in_dxf.c. ASAN report: ``` ==2468712==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x612000028084 at pc 0x000001b31b54 bp 0x7fffffffbab0 sp 0x7fffffffbaa8 WRITE of size 4 at 0x612000028084 thread T0 #0 0x1b31b53 in dxf_read_CMC /src/libredwg/src/in_dxf.c:984:23 #1 0x1b0bcc5 in add_AcDbSectionViewStyle /src/libredwg/src/in_dxf.c:8076:3 #2 0x1a94fa9 in new_object /src/libredwg/src/in_dxf.c:10590:22 #3 0x1a7813c in dxf_entities_read /src/libredwg/src/in_dxf.c:12247:18 #4 0x1a6d0d2 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12830:23 #5 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #6 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #7 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #8 0x41c40d in _start (/mnt/disk/out/libredwg/programs_asan/dxf2dwg+0x41c40d) 0x612000028084 is located 4 bytes to the right of 320-byte region [0x612000027f40,0x612000028080) allocated by thread T0 here: #0 0x497eb2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x1aa3fc3 in new_object /src/libredwg/src/./objects.inc:56:1 #2 0x1a7813c in dxf_entities_read /src/libredwg/src/in_dxf.c:12247:18 #3 0x1a6d0d2 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12830: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 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/in_dxf.c:984:23 in dxf_read_CMC Shadow bytes around the buggy address: 0x0c247fffcfc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fffcfd0: 00 00 00 00 00 00 00 00 00 00 00 00 fa fa fa fa 0x0c247fffcfe0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fffcff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fffd000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c247fffd010:[fa]fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c247fffd020: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c247fffd030: fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa 0x0c247fffd040: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c247fffd050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c247fffd060: 00 00 00 00 00 00 00 00 06 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 Shadow gap: cc ==2468712==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64263.zip dxf2dwg ./tests_64263 -o /dev/null ``` POC file : [tests_64263.zip](https://github.com/LibreDWG/libredwg/files/6652528/tests_64263.zip)
Heap-buffer-overflow in dxf_read_CMC in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/382/comments
1
2021-06-15T03:22:21Z
2021-06-24T15:54:04Z
https://github.com/LibreDWG/libredwg/issues/382
920,946,922
382
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in add_MULTILEADER in in_dxf.c:4306. ASAN report: ``` ==2370992==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60c000000300 at pc 0x000001b28d25 bp 0x7fffffffba40 sp 0x7fffffffba38 WRITE of size 8 at 0x60c000000300 thread T0 #0 0x1b28d24 in add_MULTILEADER /src/libredwg/src/in_dxf.c:4306:45 #1 0x1a90923 in new_object /src/libredwg/src/in_dxf.c:11636:26 #2 0x1a763d9 in dxf_blocks_read /src/libredwg/src/in_dxf.c:12042:22 #3 0x1a6cfbd in dwg_read_dxf /src/libredwg/src/in_dxf.c:12810: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) 0x60c000000300 is located 0 bytes to the right of 128-byte region [0x60c000000280,0x60c000000300) allocated by thread T0 here: #0 0x497eb2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x1a687d9 in xcalloc /src/libredwg/src/in_dxf.c:216:7 #2 0x1b25093 in add_MULTILEADER /src/libredwg/src/in_dxf.c:4300:35 #3 0x1a90923 in new_object /src/libredwg/src/in_dxf.c:11636:26 #4 0x1a763d9 in dxf_blocks_read /src/libredwg/src/in_dxf.c:12042:22 #5 0x1a6cfbd in dwg_read_dxf /src/libredwg/src/in_dxf.c:12810:23 #6 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #7 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #8 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/in_dxf.c:4306:45 in add_MULTILEADER Shadow bytes around the buggy address: 0x0c187fff8010: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa 0x0c187fff8020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c187fff8030: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c187fff8040: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x0c187fff8050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c187fff8060:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c187fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c187fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c187fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c187fff80a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c187fff80b0: 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 Shadow gap: cc ==2370992==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64277.zip dxf2dwg ./tests_64277 -o /dev/null ``` POC file : [tests_64277.zip](https://github.com/LibreDWG/libredwg/files/6652517/tests_64277.zip)
Heap-buffer-overflow in add_MULTILEADER in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/381/comments
0
2021-06-15T03:18:18Z
2021-06-27T06:36:33Z
https://github.com/LibreDWG/libredwg/issues/381
920,945,308
381
[ "LibreDWG", "libredwg" ]
## 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_HATCH in in_dxf.c. ASAN report: ``` ==733422==ERROR: AddressSanitizer: SEGV on unknown address 0x0000000000d0 (pc 0x000001afad89 bp 0x7fffffffbcb0 sp 0x7fffffffbb80 T0) ==733422==The signal is caused by a WRITE memory access. ==733422==Hint: address points to the zero page. #0 0x1afad89 in add_HATCH /src/libredwg/src/in_dxf.c:2806:50 #1 0x1a94216 in new_object /src/libredwg/src/in_dxf.c:10292:26 #2 0x1a7813c in dxf_entities_read /src/libredwg/src/in_dxf.c:12247:18 #3 0x1a6d0d2 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12830: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:2806:50 in add_HATCH ==733422==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64276.zip dxf2dwg ./tests_64276 -o /dev/null ``` POC file : [tests_64276.zip](https://github.com/LibreDWG/libredwg/files/6652511/tests_64276.zip)
NULL pointer dereference in function add_HATCH in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/380/comments
0
2021-06-15T03:15:00Z
2021-06-27T06:36:33Z
https://github.com/LibreDWG/libredwg/issues/380
920,944,138
380
[ "LibreDWG", "libredwg" ]
## 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_CellStyle in in_dxf.c. ASAN report: ``` ==954974==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000018 (pc 0x000001b0653c bp 0x7fffffffbcd0 sp 0x7fffffffbb40 T0) ==954974==The signal is caused by a WRITE memory access. ==954974==Hint: address points to the zero page. #0 0x1b0653c in add_CellStyle /src/libredwg/src/in_dxf.c:4563:23 #1 0x1a95787 in new_object /src/libredwg/src/in_dxf.c:10425:24 #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:4563:23 in add_CellStyle ==954974==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64272.zip dxf2dwg ./tests_64272 -o /dev/null ``` POC file : [tests_64272.zip](https://github.com/LibreDWG/libredwg/files/6652503/tests_64272.zip)
NULL pointer dereference in function add_CellStyle in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/379/comments
0
2021-06-15T03:11:52Z
2021-06-27T06:36:32Z
https://github.com/LibreDWG/libredwg/issues/379
920,943,015
379
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? Segmentation fault in dwg_free_MULTILEADER_private in dwg.spec because of reading unknown address. ASAN report: ``` ==805397==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x000000cec32d bp 0x7fffffffcce0 sp 0x7fffffffcca0 T0) ==805397==The signal is caused by a READ memory access. ==805397==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used. #0 0xcec32d in dwg_free_MULTILEADER_private /src/libredwg/src/./dwg.spec:6614:3 #1 0xcc2cdb in dwg_free_MULTILEADER /src/libredwg/src/./dwg.spec:6538:1 #2 0xcdc8ed in dwg_free_variable_type /src/libredwg/src/./classes.inc:174:3 #3 0xd68eb8 in dwg_free_object /src/libredwg/src/free.c:862:25 #4 0xd69575 in dwg_free /src/libredwg/src/free.c:1265:13 #5 0x4c95e9 in main /src/libredwg/programs/dxf2dwg.c:412:11 #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/./dwg.spec:6614:3 in dwg_free_MULTILEADER_private ==805397==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64269.zip dxf2dwg ./tests_64269 -o /dev/null ``` POC file : [tests_64269.zip](https://github.com/LibreDWG/libredwg/files/6652458/tests_64269.zip)
READ unknown address in dwg_free_MULTILEADER_private in dwg.spec
https://api.github.com/repos/LibreDWG/libredwg/issues/378/comments
0
2021-06-15T03:00:59Z
2021-06-27T06:36:32Z
https://github.com/LibreDWG/libredwg/issues/378
920,938,245
378
[ "LibreDWG", "libredwg" ]
## 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
https://api.github.com/repos/LibreDWG/libredwg/issues/376/comments
0
2021-06-11T03:40:45Z
2021-06-27T06:36:32Z
https://github.com/LibreDWG/libredwg/issues/376
918,178,282
376
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? Segmentation fault in dwg_dxf_SHAPE_private in dwg.spec because of reading unknown address. ASAN report: ``` ==19598==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x000000ee56f3 bp 0x7fffffffcc10 sp 0x7fffffffcbe0 T0) ==19598==The signal is caused by a READ memory access. ==19598==Hint: this fault was caused by a dereference of a high value address (see register values below). Disassemble the provided pc to learn which register was used. #0 0xee56f3 in dwg_dxf_SHAPE_private /src/libredwg/src/./dwg.spec #1 0xea0f59 in dwg_dxf_SHAPE /src/libredwg/src/./dwg.spec:1642:1 #2 0xe95ea0 in dwg_dxf_object /src/libredwg/src/out_dxf.c:2680:14 #3 0xe6817c in dxf_entities_write /src/libredwg/src/out_dxf.c:3532:16 #4 0xe41b4c in dwg_write_dxf /src/libredwg/src/out_dxf.c:3682:7 #5 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #6 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #7 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /src/libredwg/src/./dwg.spec in dwg_dxf_SHAPE_private ==19598==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64258.zip dxfwrite -I DWG -o /dev/null -y ./tests_64258 ``` POC file : [tests_64258.zip](https://github.com/LibreDWG/libredwg/files/6635566/tests_64258.zip)
READ unknown address in dwg_dxf_SHAPE_private in dwg.spec
https://api.github.com/repos/LibreDWG/libredwg/issues/375/comments
1
2021-06-11T03:23:28Z
2021-06-26T09:34:27Z
https://github.com/LibreDWG/libredwg/issues/375
918,169,283
375
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in bit_convert_TU in bits.c. ASAN report: ``` ==20028==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x616000001a80 at pc 0x0000004e2780 bp 0x7fffffffcab0 sp 0x7fffffffcaa8 READ of size 2 at 0x616000001a80 thread T0 #0 0x4e277f in bit_convert_TU /src/libredwg/src/bits.c:2277:15 #1 0xe7e1c2 in dwg_dxf_LTYPE_private /src/libredwg/src/./dwg.spec:3161:17 #2 0xe6c89c in dwg_dxf_LTYPE /src/libredwg/src/./dwg.spec:3132:1 #3 0xe632db in dxf_tables_write /src/libredwg/src/out_dxf.c:3118:22 #4 0xe41b24 in dwg_write_dxf /src/libredwg/src/out_dxf.c:3675:11 #5 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #6 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #7 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) 0x616000001a81 is located 0 bytes to the right of 513-byte region [0x616000001880,0x616000001a81) allocated by thread T0 here: #0 0x4969e2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x4de2ad in bit_read_TF /src/libredwg/src/bits.c:1456:25 #2 0x749d6f in dwg_decode_LTYPE_private /src/libredwg/src/./dwg.spec:3212:7 #3 0x59ae8d in dwg_decode_LTYPE /src/libredwg/src/./dwg.spec:3132:1 #4 0x5901c2 in dwg_decode_add_object /src/libredwg/src/decode.c:5779:15 #5 0x5d2c9b in read_2004_section_handles /src/libredwg/src/decode.c:2928:19 #6 0x4fa481 in decode_R2004 /src/libredwg/src/decode.c:3778:12 #7 0x4e77f3 in dwg_decode /src/libredwg/src/decode.c #8 0x4c9f9e in dwg_read_file /src/libredwg/src/dwg.c:254:11 #9 0x4c8121 in main /src/libredwg/programs/dxfwrite.c:321:15 #10 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/bits.c:2277:15 in bit_convert_TU Shadow bytes around the buggy address: 0x0c2c7fff8300: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff8310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8320: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8330: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8340: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c2c7fff8350:[01]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff8360: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2c7fff8370: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8380: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff8390: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2c7fff83a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 Shadow gap: cc ==20028==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64260.zip dxfwrite -I DWG -o /dev/null -y ./tests_64260 ``` POC file : [tests_64260.zip](https://github.com/LibreDWG/libredwg/files/6635543/tests_64260.zip)
Heap-buffer-overflow in bit_convert_TU in bits.c
https://api.github.com/repos/LibreDWG/libredwg/issues/374/comments
1
2021-06-11T03:12:22Z
2021-06-26T09:30:17Z
https://github.com/LibreDWG/libredwg/issues/374
918,163,264
374
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in dwg_dxf_SHAPE_private in dwg.spec. ASAN report: ``` ==2711==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000d70 at pc 0x000000ee5b42 bp 0x7fffffffcbd0 sp 0x7fffffffcbc8 READ of size 8 at 0x602000000d70 thread T0 #0 0xee5b41 in dwg_dxf_SHAPE_private /src/libredwg/src/./dwg.spec:1675:40 #1 0xea0f59 in dwg_dxf_SHAPE /src/libredwg/src/./dwg.spec:1642:1 #2 0xe95ea0 in dwg_dxf_object /src/libredwg/src/out_dxf.c:2680:14 #3 0xe6817c in dxf_entities_write /src/libredwg/src/out_dxf.c:3532:16 #4 0xe41b4c in dwg_write_dxf /src/libredwg/src/out_dxf.c:3682:7 #5 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #6 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #7 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) 0x602000000d71 is located 0 bytes to the right of 1-byte region [0x602000000d70,0x602000000d71) allocated by thread T0 here: #0 0x49684d in malloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3 #1 0x4ded20 in bit_read_TV /src/libredwg/src/bits.c:1547:28 #2 0x7b8edb in dwg_decode_MLINESTYLE_private /src/libredwg/src/./dwg.spec:3966:3 #3 0x59d003 in dwg_decode_MLINESTYLE /src/libredwg/src/./dwg.spec:3962:1 #4 0x5904de in dwg_decode_add_object /src/libredwg/src/decode.c:5821:15 #5 0x4efe14 in decode_R13_R2000 /src/libredwg/src/decode.c:1342:19 #6 0x4e77c1 in dwg_decode /src/libredwg/src/decode.c:246:36 #7 0x4c9f9e in dwg_read_file /src/libredwg/src/dwg.c:254:11 #8 0x4c8121 in main /src/libredwg/programs/dxfwrite.c:321:15 #9 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/./dwg.spec:1675:40 in dwg_dxf_SHAPE_private Shadow bytes around the buggy address: 0x0c047fff8150: fa fa 00 02 fa fa 01 fa fa fa 00 fa fa fa 00 06 0x0c047fff8160: fa fa 01 fa fa fa 01 fa fa fa 01 fa fa fa 01 fa 0x0c047fff8170: fa fa 01 fa fa fa 07 fa fa fa 00 06 fa fa 00 04 0x0c047fff8180: fa fa 01 fa fa fa 00 06 fa fa 01 fa fa fa 01 fa 0x0c047fff8190: fa fa 01 fa fa fa 00 fa fa fa 00 02 fa fa 01 fa =>0x0c047fff81a0: fa fa 00 06 fa fa 00 04 fa fa 04 fa fa fa[01]fa 0x0c047fff81b0: fa fa 01 fa fa fa 01 fa fa fa 01 fa fa fa 07 fa 0x0c047fff81c0: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff81d0: fa fa 00 fa fa fa 00 fa fa fa 00 01 fa fa 00 01 0x0c047fff81e0: fa fa 00 01 fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff81f0: fa fa 00 04 fa fa 00 01 fa fa 06 fa fa fa 00 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 Shadow gap: cc ==2711==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64257.zip dxfwrite -I DWG -o /dev/null -y ./tests_64257 ``` POC file : [tests_64257.zip](https://github.com/LibreDWG/libredwg/files/6635509/tests_64257.zip)
Heap-buffer-overflow in dwg_dxf_SHAPE_private in dwg.spec
https://api.github.com/repos/LibreDWG/libredwg/issues/373/comments
1
2021-06-11T03:03:18Z
2022-02-05T13:19:35Z
https://github.com/LibreDWG/libredwg/issues/373
918,158,456
373
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in dwg_dxf_LWPOLYLINE_private in dwg.spec. ASAN report: ``` ==25881==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x617000002d10 at pc 0x000000ef927b bp 0x7fffffffcb10 sp 0x7fffffffcb08 READ of size 8 at 0x617000002d10 thread T0 #0 0xef927a in dwg_dxf_LWPOLYLINE_private /src/libredwg/src/./dwg.spec:4832:14 #1 0xea80fb in dwg_dxf_LWPOLYLINE /src/libredwg/src/./dwg.spec:4790:1 #2 0xe95e19 in dwg_dxf_object /src/libredwg/src/out_dxf.c:2747:14 #3 0xe95916 in dxf_block_write /src/libredwg/src/out_dxf.c:3453:18 #4 0xe67e33 in dxf_blocks_write /src/libredwg/src/out_dxf.c:3505:20 #5 0xe41b38 in dwg_write_dxf /src/libredwg/src/out_dxf.c:3678:11 #6 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #7 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #8 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) 0x617000002d10 is located 0 bytes to the right of 656-byte region [0x617000002a80,0x617000002d10) allocated by thread T0 here: #0 0x4969e2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x7c2f2f in dwg_decode_LWPOLYLINE_private /src/libredwg/src/./dwg.spec:4868:5 #2 0x59d983 in dwg_decode_LWPOLYLINE /src/libredwg/src/./dwg.spec:4790:1 #3 0x58fcdf in dwg_decode_add_object /src/libredwg/src/decode.c:5833:15 #4 0x4efe14 in decode_R13_R2000 /src/libredwg/src/decode.c:1342:19 #5 0x4e77c1 in dwg_decode /src/libredwg/src/decode.c:246:36 #6 0x4c9f9e in dwg_read_file /src/libredwg/src/dwg.c:254:11 #7 0x4c8121 in main /src/libredwg/programs/dxfwrite.c:321:15 #8 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/./dwg.spec:4832:14 in dwg_dxf_LWPOLYLINE_private Shadow bytes around the buggy address: 0x0c2e7fff8550: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff8560: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff8570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff8580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff8590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c2e7fff85a0: 00 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2e7fff85b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c2e7fff85c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff85d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff85e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c2e7fff85f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 Shadow gap: cc ==25881==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64255.zip dxfwrite -I DWG -o /dev/null -y ./tests_64255 ``` POC file : [tests_64255.zip](https://github.com/LibreDWG/libredwg/files/6635498/tests_64255.zip)
Heap-buffer-overflow in dwg_dxf_LWPOLYLINE_private in dwg.spec
https://api.github.com/repos/LibreDWG/libredwg/issues/372/comments
0
2021-06-11T03:01:31Z
2021-06-27T06:36:31Z
https://github.com/LibreDWG/libredwg/issues/372
918,157,504
372
[ "LibreDWG", "libredwg" ]
## 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 bit_eq_T in bits.c. ASAN report: ``` ==3404==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000042e870 bp 0x7fffffffc8e0 sp 0x7fffffffc080 T0) ==3404==The signal is caused by a READ memory access. ==3404==Hint: address points to the zero page. #0 0x42e870 in strcmp /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:444:25 #1 0x4e453e in bit_eq_T /src/libredwg/src/bits.c:2643:13 #2 0xe3a82a in dxf_has_STYLE_eed /src/libredwg/src/out_dxf.c:1382:15 #3 0xe812b2 in dwg_dxf_STYLE_private /src/libredwg/src/./dwg.spec:3087:39 #4 0xe6fd1c in dwg_dxf_STYLE /src/libredwg/src/./dwg.spec:3045:1 #5 0xe64169 in dxf_tables_write /src/libredwg/src/out_dxf.c:3178:26 #6 0xe41b24 in dwg_write_dxf /src/libredwg/src/out_dxf.c:3675:11 #7 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #8 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #9 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:444:25 in strcmp ==3404==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64252.zip dxfwrite -I DWG -o /dev/null -y ./tests_64252 ``` POC file : [tests_64252.zip](https://github.com/LibreDWG/libredwg/files/6635494/tests_64252.zip)
Null pointer dereference in function bit_eq_T in bits.c
https://api.github.com/repos/LibreDWG/libredwg/issues/371/comments
0
2021-06-11T02:59:33Z
2022-02-05T13:21:00Z
https://github.com/LibreDWG/libredwg/issues/371
918,156,392
371
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in add_ASSOCACTION in in_dxf.c. ASAN report: ``` ==24181==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6040000042b8 at pc 0x00000049718a bp 0x7fffffffbaf0 sp 0x7fffffffb2b8 WRITE of size 48 at 0x6040000042b8 thread T0 #0 0x497189 in __asan_memcpy /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 #1 0x1ad7ba3 in add_ASSOCACTION /src/libredwg/src/in_dxf.c:5924:23 #2 0x1a8b7a4 in new_object /src/libredwg/src/in_dxf.c:9331:26 #3 0x1a78816 in dxf_objects_read /src/libredwg/src/in_dxf.c:12301:22 #4 0x1a6d0f9 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12838:23 #5 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #6 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #7 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #8 0x41c40d in _start (/mnt/disk/out/libredwg/programs_asan/dxf2dwg+0x41c40d) 0x6040000042b8 is located 0 bytes to the right of 40-byte region [0x604000004290,0x6040000042b8) allocated by thread T0 here: #0 0x497eb2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x1a687d9 in xcalloc /src/libredwg/src/in_dxf.c:216:7 #2 0x1ad7b18 in add_ASSOCACTION /src/libredwg/src/in_dxf.c:5915:38 #3 0x1a8b7a4 in new_object /src/libredwg/src/in_dxf.c:9331:26 #4 0x1a78816 in dxf_objects_read /src/libredwg/src/in_dxf.c:12301:22 #5 0x1a6d0f9 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12838:23 #6 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #7 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #8 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy Shadow bytes around the buggy address: 0x0c087fff8800: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa 0x0c087fff8810: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa 0x0c087fff8820: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa 0x0c087fff8830: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa 0x0c087fff8840: fa fa 00 00 00 00 00 fa fa fa 00 00 00 00 00 fa =>0x0c087fff8850: fa fa 00 00 00 00 00[fa]fa fa 00 00 00 00 00 00 0x0c087fff8860: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8870: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff8890: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c087fff88a0: 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 Shadow gap: cc ==24181==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64248.zip dxf2dwg ./tests_64248 -o /dev/null ``` POC file : [tests_64248.zip](https://github.com/LibreDWG/libredwg/files/6630146/tests_64248.zip)
Heap-buffer-overflow in add_ASSOCACTION in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/370/comments
2
2021-06-10T09:40:56Z
2022-02-05T13:22:48Z
https://github.com/LibreDWG/libredwg/issues/370
917,137,417
370
[ "LibreDWG", "libredwg" ]
## 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 dwg_handle_name in dwg.c. ASAN report: ``` ==15787==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7ffff6f4e7c6 bp 0x7fffffffc950 sp 0x7fffffffc108 T0) ==15787==The signal is caused by a READ memory access. ==15787==Hint: address points to the zero page. #0 0x7ffff6f4e7c6 in strlen /build/glibc-S7Ft5T/glibc-2.23/string/../sysdeps/x86_64/strlen.S:106 #1 0x481fe2 in strdup /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors.cpp:433:17 #2 0x4d50ed in dwg_handle_name /src/libredwg/src/dwg.c:2545:30 #3 0x5c216e in dwg_dim_blockname /src/libredwg/src/decode.c:5998:22 #4 0xee1c09 in dwg_dxf_DIMENSION_DIAMETER_private /src/libredwg/src/./dwg.spec:1416:3 #5 0xe9f979 in dwg_dxf_DIMENSION_DIAMETER /src/libredwg/src/./dwg.spec:1414:1 #6 0xe9655f in dwg_dxf_object /src/libredwg/src/out_dxf.c:2670:14 #7 0xe6817c in dxf_entities_write /src/libredwg/src/out_dxf.c:3532:16 #8 0xe41b4c in dwg_write_dxf /src/libredwg/src/out_dxf.c:3682:7 #9 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #10 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #11 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /build/glibc-S7Ft5T/glibc-2.23/string/../sysdeps/x86_64/strlen.S:106 in strlen ==15787==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64245.zip dxfwrite -I DWG -o /dev/null -y ./tests_64245 ``` POC file : [tests_64245.zip](https://github.com/LibreDWG/libredwg/files/6629947/tests_64245.zip)
Null pointer dereference in function dwg_handle_name in dwg.c
https://api.github.com/repos/LibreDWG/libredwg/issues/369/comments
2
2021-06-10T09:11:12Z
2022-02-05T13:26:04Z
https://github.com/LibreDWG/libredwg/issues/369
917,107,466
369
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in bit_write_TF in bits.c. ASAN report: ``` ==25604==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x626000008bbf at pc 0x000000495c07 bp 0x7fffffffc790 sp 0x7fffffffbf58 READ of size 209 at 0x626000008bbf thread T0 #0 0x495c06 in __asan_memcpy /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 #1 0x4de8e4 in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53:10 #2 0x4de8e4 in bit_write_TF /src/libredwg/src/bits.c:1525:7 #3 0xe3ffca in dwg_convert_SAB_to_SAT1 /src/libredwg/src/out_dxf.c:2043:15 #4 0xeebd9e in dxf_3dsolid /src/libredwg/src/out_dxf.c:2334:20 #5 0xeecb01 in dwg_dxf__3DSOLID_private /src/libredwg/src/./dwg.spec:2370:3 #6 0xea23e2 in dwg_dxf__3DSOLID /src/libredwg/src/./dwg.spec:2369:1 #7 0xe9677d in dwg_dxf_object /src/libredwg/src/out_dxf.c:2690:14 #8 0xe6817c in dxf_entities_write /src/libredwg/src/out_dxf.c:3532:16 #9 0xe41b4c in dwg_write_dxf /src/libredwg/src/out_dxf.c:3682:7 #10 0x4c864b in main /src/libredwg/programs/dxfwrite.c:451:11 #11 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #12 0x41bc98 in _start (/mnt/disk/out/libredwg/programs_asan/dxfwrite+0x41bc98) 0x626000008bbf is located 0 bytes to the right of 10943-byte region [0x626000006100,0x626000008bbf) allocated by thread T0 here: #0 0x4969e2 in calloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:154:3 #1 0x6d69d4 in decode_3dsolid /src/libredwg/src/./dwg.spec:2081:57 #2 0x6d7fa1 in dwg_decode__3DSOLID_private /src/libredwg/src/./dwg.spec:2370:3 #3 0x59888d in dwg_decode__3DSOLID /src/libredwg/src/./dwg.spec:2369:1 #4 0x5901b0 in dwg_decode_add_object /src/libredwg/src/decode.c:5719:15 #5 0xc839d6 in read_2007_section_handles /src/libredwg/src/decode_r2007.c:1694:19 #6 0xc7b417 in read_r2007_meta_data /src/libredwg/src/decode_r2007.c:2388:12 #7 0x4fd4be in decode_R2007 /src/libredwg/src/decode.c:3836:11 #8 0x4e789b in dwg_decode /src/libredwg/src/decode.c:248:29 #9 0x4c9f9e in dwg_read_file /src/libredwg/src/dwg.c:254:11 #10 0x4c8121 in main /src/libredwg/programs/dxfwrite.c:321:15 #11 0x7ffff6ee383f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy Shadow bytes around the buggy address: 0x0c4c7fff9120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4c7fff9130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4c7fff9140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4c7fff9150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c4c7fff9160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c4c7fff9170: 00 00 00 00 00 00 00[07]fa fa fa fa fa fa fa fa 0x0c4c7fff9180: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4c7fff9190: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4c7fff91a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4c7fff91b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c4c7fff91c0: 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 Shadow gap: cc ==25604==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64243.zip dxfwrite -I DWG -o /dev/null -y ./tests_64243 ``` POC file : [tests_64243.zip](https://github.com/LibreDWG/libredwg/files/6629920/tests_64243.zip)
Heap-buffer-overflow in bit_write_TF in bits.c call by dwg_convert_SAB_to_SAT1
https://api.github.com/repos/LibreDWG/libredwg/issues/368/comments
1
2021-06-10T09:08:12Z
2022-02-05T13:26:52Z
https://github.com/LibreDWG/libredwg/issues/368
917,104,499
368
[ "LibreDWG", "libredwg" ]
## 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 dxf_read_CMC in in_dxf.c. ASAN report: ``` ==2463508==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000001b314cb bp 0x7fffffffbad0 sp 0x7fffffffba80 T0) ==2463508==The signal is caused by a READ memory access. ==2463508==Hint: address points to the zero page. #0 0x1b314cb in dxf_read_CMC /src/libredwg/src/in_dxf.c:980:13 #1 0x1b319f9 in dxf_read_CMC /src/libredwg/src/in_dxf.c:999:15 #2 0x1b10909 in add_AcDbDetailViewStyle /src/libredwg/src/in_dxf.c:8124:3 #3 0x1a946f0 in new_object /src/libredwg/src/in_dxf.c:10600:22 #4 0x1a78816 in dxf_objects_read /src/libredwg/src/in_dxf.c:12301:22 #5 0x1a6d0f9 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12838:23 #6 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #7 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #8 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #9 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:980:13 in dxf_read_CMC ==2463508==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64235.zip dxf2dwg ./tests_64235 -o /dev/null ``` POC file : [tests_64235.zip](https://github.com/LibreDWG/libredwg/files/6629712/tests_64235.zip)
Null pointer dereference in function dxf_read_CMC in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/367/comments
2
2021-06-10T08:37:16Z
2022-02-05T13:27:41Z
https://github.com/LibreDWG/libredwg/issues/367
917,072,413
367
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in dxf_tables_read in in_dxf.c:11968. ASAN report: ``` ==2899325==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000001ca8 at pc 0x000001a74abb bp 0x7fffffffc990 sp 0x7fffffffc988 READ of size 8 at 0x603000001ca8 thread T0 #0 0x1a74aba in dxf_tables_read /src/libredwg/src/in_dxf.c:11968:54 #1 0x1a6ce22 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12779:23 #2 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #3 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #4 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #5 0x41c40d in _start (/mnt/disk/out/libredwg/programs_asan/dxf2dwg+0x41c40d) 0x603000001ca8 is located 244 bytes to the right of 20-byte region [0x603000001ba0,0x603000001bb4) allocated by thread T0 here: #0 0x483614 in strdup /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors.cpp:437:3 #1 0x1a685b1 in array_push /src/libredwg/src/in_dxf.c:730:25 #2 0x1ad02a4 in add_eed /src/libredwg/src/in_dxf.c:1763:26 #3 0x1a96958 in new_object /src/libredwg/src/in_dxf.c:10041:13 #4 0x1a73b0a in dxf_tables_read /src/libredwg/src/in_dxf.c:11909:22 #5 0x1a6ce22 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12779:23 #6 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #7 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #8 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 SUMMARY: AddressSanitizer: heap-buffer-overflow /src/libredwg/src/in_dxf.c:11968:54 in dxf_tables_read Shadow bytes around the buggy address: 0x0c067fff8340: 02 fa fa fa fd fd fd fa fa fa fd fd fd fa fa fa 0x0c067fff8350: fd fd fd fa fa fa 00 00 06 fa fa fa 00 00 04 fa 0x0c067fff8360: fa fa fd fd fd fa fa fa 00 00 03 fa fa fa fd fd 0x0c067fff8370: fd fa fa fa 00 00 04 fa fa fa fa fa fa fa fa fa 0x0c067fff8380: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c067fff8390: fa fa fa fa fa[fa]fa fa fa fa fa fa fa fa fa fa 0x0c067fff83a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff83b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff83c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff83d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff83e0: 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 Shadow gap: cc ==2899325==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64241.zip dxf2dwg ./tests_64241 -o /dev/null ``` POC file : [tests_64241.zip](https://github.com/LibreDWG/libredwg/files/6629665/tests_64241.zip)
Heap-buffer-overflow in dxf_tables_read in in_dxf.c
https://api.github.com/repos/LibreDWG/libredwg/issues/366/comments
1
2021-06-10T08:31:08Z
2022-02-05T13:32:50Z
https://github.com/LibreDWG/libredwg/issues/366
917,066,500
366
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A stack buffer overflow was discovered in dwg_dynapi_entity_value in gen-dynapi.pl. ASAN report: ``` ==2500853==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffbfa8 at pc 0x00000049718a bp 0x7fffffffbc10 sp 0x7fffffffb3d8 WRITE of size 72 at 0x7fffffffbfa8 thread T0 #0 0x497189 in __asan_memcpy /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 #1 0xd738f2 in memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10 #2 0xd738f2 in dwg_dynapi_entity_value /src/libredwg/src/gen-dynapi.pl:2766:7 #3 0x1a8df9d in new_object /src/libredwg/src/in_dxf.c:11220:23 #4 0x1a78816 in dxf_objects_read /src/libredwg/src/in_dxf.c:12301:22 #5 0x1a6d0f9 in dwg_read_dxf /src/libredwg/src/in_dxf.c:12838:23 #6 0x4cb82a in dxf_read_file /src/libredwg/src/dwg.c:381:13 #7 0x4c91c4 in main /src/libredwg/programs/dxf2dwg.c:312:15 #8 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #9 0x41c40d in _start (/mnt/disk/out/libredwg/programs_asan/dxf2dwg+0x41c40d) Address 0x7fffffffbfa8 is located in stack of thread T0 at offset 680 in frame #0 0x1a81d3f in new_object /src/libredwg/src/in_dxf.c:8772 This frame has 51 object(s): [32, 112) 'ctrlname' (line 8778) [144, 224) 'subclass' (line 8779) [256, 512) 'text' (line 8780) [576, 580) 'j' (line 8788) [592, 596) 'k' (line 8788) [608, 612) 'l' (line 8788) [624, 626) 'flag' (line 8793) [640, 641) 'scale_flag' (line 8794) [656, 680) 'pt' (line 8795) [720, 721) 'is_xref_ref' (line 8950) <== Memory access at offset 680 partially underflows this variable [736, 744) 'width_factor' (line 8966) <== Memory access at offset 680 partially underflows this variable [768, 776) 'hdls' (line 9115) [800, 804) 'num_entries' (line 9116) [816, 824) 'handle12421' (line 9158) [848, 856) 'inserts' (line 9423) [880, 884) 'num_inserts' (line 9425) [896, 900) 'revision_major' (line 9671) [912, 914) 'revision_minor1' (line 9672) [928, 930) 'revision_minor2' (line 9673) [944, 953) 'revision_bytes' (line 9674) [976, 1015) 'revision_guid' (line 9678) [1056, 1068) 'u13998' (line 9680) [1088, 1089) 'bit' (line 9734) [1104, 1106) 'ver' (line 9838) [1120, 1122) 'ver14611' (line 9849) [1136, 1184) 'color15069' (line 10024) [1216, 1217) 'linewt15544' (line 10202) [1232, 1233) 'dataflags' (line 10302) [1248, 1328) 'key' (line 10403) [1360, 1364) 'num_clip_verts' (line 10792) [1376, 1384) 'clip_verts' (line 10793) [1408, 1416) 'pts' (line 10865) [1440, 1480) 'fieldname' (line 10930) [1520, 1528) 'ang' (line 10988) [1552, 1560) 'd2t' (line 11006) [1584, 1592) 'ref17657' (line 11019) [1616, 1664) 'color17910' (line 11128) [1696, 1697) 'z_is_zero' (line 11273) [1712, 1720) 'matrix' (line 11295) [1744, 1748) 'unique' (line 11325) [1760, 1768) 'ref18480' (line 11339) [1792, 1800) 'ref18507' (line 11359) [1824, 1840) 'pt2' (line 11401) [1856, 1904) 'color18693' (line 11428) [1936, 1944) 'handle18831' (line 11479) [1968, 1969) 'flags' (line 11513) [1984, 1985) 'flags18957' (line 11528) [2000, 2001) 'flags18978' (line 11543) [2016, 2024) 'ptr' (line 11583) [2048, 2056) 'ang19733' (line 11803) [2080, 2088) 'ang19780' (line 11815) HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy Shadow bytes around the buggy address: 0x10007fff77a0: f1 f1 f1 f1 00 00 00 00 00 00 00 00 00 00 f2 f2 0x10007fff77b0: f2 f2 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2 0x10007fff77c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007fff77d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10007fff77e0: f2 f2 f2 f2 f2 f2 f2 f2 04 f2 04 f2 04 f2 02 f2 =>0x10007fff77f0: 01 f2 00 00 00[f2]f2 f2 f2 f2 f8 f2 f8 f2 f2 f2 0x10007fff7800: f8 f2 f2 f2 f8 f2 f8 f2 f2 f2 f8 f2 f2 f2 f8 f2 0x10007fff7810: f8 f2 f8 f2 f8 f2 f8 f8 f2 f2 f8 f8 f8 f8 f8 f2 0x10007fff7820: f2 f2 f2 f2 f8 f8 f2 f2 f8 f2 f8 f2 f8 f2 f8 f8 0x10007fff7830: f8 f8 f8 f8 f2 f2 f2 f2 f8 f2 f8 f2 f8 f8 f8 f8 0x10007fff7840: f8 f8 f8 f8 f8 f8 f2 f2 f2 f2 f8 f2 f8 f2 f2 f2 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 Shadow gap: cc ==2500853==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64237.zip dxf2dwg ./tests_64237 -o /dev/null ``` POC file : [tests_64237.zip](https://github.com/LibreDWG/libredwg/files/6629621/tests_64237.zip)
Stack-buffer-overflow in dwg_dynapi_entity_value in gen-dynapi.pl
https://api.github.com/repos/LibreDWG/libredwg/issues/365/comments
1
2021-06-10T08:25:24Z
2022-02-05T13:34:05Z
https://github.com/LibreDWG/libredwg/issues/365
917,060,945
365
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? Segmentation fault in dwg_encode_add_object in encode.c:3877 because of reading unknown address. ASAN report: ``` $ ./dwgrewrite ./pocs/tests_64229 ...... ...... ...... ==2884155==ERROR: AddressSanitizer: SEGV on unknown address 0x7fffe435c89f (pc 0x0000004ab9e0 bp 0x7fffffffc360 sp 0x7fffffffbb10 T0) ==2884155==The signal is caused by a READ memory access. #0 0x4ab9e0 in __sanitizer::internal_memmove(void*, void const*, unsigned long) /src/llvm-project-12.0.0.src/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp:68:16 #1 0x497605 in __asan_memmove /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:30:3 #2 0xfe6ba3 in memmove /usr/include/x86_64-linux-gnu/bits/string_fortified.h:40:10 #3 0xfe6ba3 in dwg_encode_add_object /src/libredwg/src/encode.c:3877:11 #4 0xf98c78 in dwg_encode /src/libredwg/src/encode.c:2352:16 #5 0x4cbcf6 in dwg_write_file /src/libredwg/src/dwg.c:429:11 #6 0x4c939f in main /src/libredwg/programs/dwgrewrite.c:349:11 #7 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #8 0x41c3fd in _start (/mnt/disk/out/libredwg/programs_asan/dwgrewrite+0x41c3fd) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /src/llvm-project-12.0.0.src/compiler-rt/lib/sanitizer_common/sanitizer_libc.cpp:68:16 in __sanitizer::internal_memmove(void*, void const*, unsigned long) ==2884155==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64229.zip dwgrewrite ./tests_64229 ``` POC file : [tests_64229.zip](https://github.com/LibreDWG/libredwg/files/6622261/tests_64229.zip)
READ unknown address in dwg_encode_add_object in encode.c:3877
https://api.github.com/repos/LibreDWG/libredwg/issues/364/comments
3
2021-06-09T08:27:30Z
2023-06-27T10:20:47Z
https://github.com/LibreDWG/libredwg/issues/364
915,935,218
364
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap use after free was discovered in bit_copy_chain in src/bits.c:3318. ASAN report: ``` $ ./dwgrewrite ./pocs/tests_64233 ...... ...... ...... ==3021191==ERROR: AddressSanitizer: heap-use-after-free on address 0x7ffff2b59800 at pc 0x0000004970c7 bp 0x7fffffffba70 sp 0x7fffffffb238 READ of size 282028 at 0x7ffff2b59800 thread T0 #0 0x4970c6 in __asan_memcpy /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 #1 0x4e732c in memcpy /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10 #2 0x4e732c in bit_copy_chain /src/libredwg/src/bits.c:3318:7 #3 0x102955f in obj_flush_hdlstream /src/libredwg/src/encode.c:784:3 #4 0x159ce6f in dwg_encode_PLANESURFACE_private /src/libredwg/src/./dwg.spec:8832:3 #5 0x12e1e11 in dwg_encode_PLANESURFACE /src/libredwg/src/./dwg.spec:8818:1 #6 0x1005fae in dwg_encode_variable_type /src/libredwg/src/./classes.inc:243:3 #7 0xfe71d6 in dwg_encode_add_object /src/libredwg/src/encode.c:3771:28 #8 0xf98c78 in dwg_encode /src/libredwg/src/encode.c:2352:16 #9 0x4cbcf6 in dwg_write_file /src/libredwg/src/dwg.c:429:11 #10 0x4c939f in main /src/libredwg/programs/dwgrewrite.c:349:11 #11 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #12 0x41c3fd in _start (/mnt/disk/out/libredwg/programs_asan/dwgrewrite+0x41c3fd) 0x7ffff2b59800 is located 0 bytes inside of 282624-byte region [0x7ffff2b59800,0x7ffff2b9e800) freed by thread T0 here: #0 0x498003 in realloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3 #1 0x4d8122 in bit_chain_alloc /src/libredwg/src/bits.c:3026:30 #2 0x4e7260 in bit_copy_chain /src/libredwg/src/bits.c:3314:5 #3 0x102955f in obj_flush_hdlstream /src/libredwg/src/encode.c:784:3 #4 0x159ce6f in dwg_encode_PLANESURFACE_private /src/libredwg/src/./dwg.spec:8832:3 #5 0x12e1e11 in dwg_encode_PLANESURFACE /src/libredwg/src/./dwg.spec:8818:1 #6 0x1005fae in dwg_encode_variable_type /src/libredwg/src/./classes.inc:243:3 #7 0xfe71d6 in dwg_encode_add_object /src/libredwg/src/encode.c:3771:28 #8 0xf98c78 in dwg_encode /src/libredwg/src/encode.c:2352:16 #9 0x4cbcf6 in dwg_write_file /src/libredwg/src/dwg.c:429:11 #10 0x4c939f in main /src/libredwg/programs/dwgrewrite.c:349:11 #11 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 previously allocated by thread T0 here: #0 0x498003 in realloc /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_malloc_linux.cpp:164:3 #1 0x4d8122 in bit_chain_alloc /src/libredwg/src/bits.c:3026:30 #2 0xfe5ec7 in dwg_encode_add_object /src/libredwg/src/encode.c:3490:5 #3 0xf98c78 in dwg_encode /src/libredwg/src/encode.c:2352:16 #4 0x4cbcf6 in dwg_write_file /src/libredwg/src/dwg.c:429:11 #5 0x4c939f in main /src/libredwg/programs/dwgrewrite.c:349:11 #6 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 SUMMARY: AddressSanitizer: heap-use-after-free /src/llvm-project-12.0.0.src/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy Shadow bytes around the buggy address: 0x10007e5632b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x10007e5632c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x10007e5632d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x10007e5632e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x10007e5632f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x10007e563300:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x10007e563310: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x10007e563320: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x10007e563330: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x10007e563340: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x10007e563350: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 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 Shadow gap: cc ==3021191==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64233.zip dwgrewrite ./tests_64233 ``` POC file : [tests_64233.zip](https://github.com/LibreDWG/libredwg/files/6622104/tests_64233.zip)
Heap use after free in bit_copy_chain in src/bits.c:3318
https://api.github.com/repos/LibreDWG/libredwg/issues/361/comments
1
2021-06-09T08:09:06Z
2023-07-17T10:47:58Z
https://github.com/LibreDWG/libredwg/issues/361
915,918,922
361
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? Segmentation fault in bit_write_RC in bits.c:351 because of writing unknown address. ASAN report: ``` $ ./dwgrewrite ./pocs/tests_64234 ...... ...... ...... ==3089790==ERROR: AddressSanitizer: SEGV on unknown address 0x7fffc210e8de (pc 0x0000004d8f90 bp 0x7fffffffc320 sp 0x7fffffffc2e0 T0) ==3089790==The signal is caused by a WRITE memory access. #0 0x4d8f90 in bit_write_RC /src/libredwg/src/bits.c:351:29 #1 0x4d9443 in bit_write_RS /src/libredwg/src/bits.c:400:3 #2 0x4dbf93 in bit_write_MS /src/libredwg/src/bits.c:1019:3 #3 0xfe6d31 in dwg_encode_add_object /src/libredwg/src/encode.c:3893:7 #4 0xf98c78 in dwg_encode /src/libredwg/src/encode.c:2352:16 #5 0x4cbcf6 in dwg_write_file /src/libredwg/src/dwg.c:429:11 #6 0x4c939f in main /src/libredwg/programs/dwgrewrite.c:349:11 #7 0x7ffff7c580b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16 #8 0x41c3fd in _start (/mnt/disk/out/libredwg/programs_asan/dwgrewrite+0x41c3fd) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /src/libredwg/src/bits.c:351:29 in bit_write_RC ==3089790==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64234.zip dwgrewrite ./tests_64234 ``` POC file : [tests_64234.zip](https://github.com/LibreDWG/libredwg/files/6622058/tests_64234.zip)
A Segmentation fault in bit_write_RC in bits.c:351
https://api.github.com/repos/LibreDWG/libredwg/issues/360/comments
1
2021-06-09T08:01:17Z
2022-12-15T15:42:18Z
https://github.com/LibreDWG/libredwg/issues/360
915,912,147
360
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4, (also in the latest commit 45d2a29) There is heapbuffer-overflow in function dwg_encode_STYLE_private() in dwg.spec **reproduce** ./configure --enable-release CFLAGS="-fsanitize=address" ./configure --enable-release make ./dwgrewrite [poc] [heap-buffer-overflow_dwg_encode_STYLE_private.zip](https://github.com/LibreDWG/libredwg/files/6622024/heap-buffer-overflow_dwg_encode_STYLE_private.zip) ```c AddressSanitizer: heap-buffer-overflow on address 0x6020000020a0 at pc 0x562610b3fe1f bp 0x7ffeebfe3ae0 sp 0x7ffeebfe3ad0 READ of size 8 at 0x6020000020a0 thread T0 #0 0x562610b3fe1e in dwg_encode_STYLE_private /home/chiba/libredwg-check/src/dwg.spec:3047 #1 0x562610b3ef8e in dwg_encode_STYLE /home/chiba/libredwg-check/src/dwg.spec:3045 #2 0x5626118b3912 in dwg_encode_add_object /home/chiba/libredwg-check/src/encode.c:3667 #3 0x5626108a2eb6 in dwg_encode /home/chiba/libredwg-check/src/encode.c:2352 #4 0x56260f65e78d in dwg_write_file /home/chiba/libredwg-check/src/dwg.c:429 #5 0x56260f65af4f in main /home/chiba/libredwg-check/programs/dwgrewrite.c:349 #6 0x7fd6bdaa50b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #7 0x56260f659bad in _start (/home/chiba/libredwg-check/asan-master/bin/dwgrewrite+0x207bad) 0x6020000020a0 is located 8 bytes to the right of 8-byte region [0x602000002090,0x602000002098) allocated by thread T0 here: #0 0x7fd6bdeccdc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x56260fc3f748 in dwg_setup_UNKNOWN_OBJ /home/chiba/libredwg-check/src/dwg.spec:7005 #2 0x56260fc3fcb5 in dwg_decode_UNKNOWN_OBJ /home/chiba/libredwg-check/src/dwg.spec:7005 #3 0x5626101c19b8 in dwg_decode_add_object /home/chiba/libredwg-check/src/decode.c:5900 #4 0x56260f72435f in read_2004_section_handles /home/chiba/libredwg-check/src/decode.c:2928 #5 0x56260f77dfd0 in decode_R2004 /home/chiba/libredwg-check/src/decode.c:3778 #6 0x56260f686735 in dwg_decode /home/chiba/libredwg-check/src/decode.c:252 #7 0x56260f65cb78 in dwg_read_file /home/chiba/libredwg-check/src/dwg.c:254 #8 0x56260f65ab44 in main /home/chiba/libredwg-check/programs/dwgrewrite.c:290 #9 0x7fd6bdaa50b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-buffer-overflow /home/chiba/libredwg-check/src/dwg.spec:3047 in dwg_encode_STYLE_private Shadow bytes around the buggy address: 0x0c047fff83c0: fa fa 00 fa fa fa 00 04 fa fa 00 fa fa fa 00 fa 0x0c047fff83d0: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff83e0: fa fa 00 fa fa fa 00 02 fa fa 00 fa fa fa 00 04 0x0c047fff83f0: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff8400: fa fa 02 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa =>0x0c047fff8410: fa fa 00 fa[fa]fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff8420: fa fa 00 fa fa fa 00 fa fa fa 02 fa fa fa 00 fa 0x0c047fff8430: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff8440: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff8450: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff8460: fa fa 00 fa fa fa 00 fa fa fa 04 fa fa fa 00 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 Shadow gap: cc ==2429575==ABORTING ```
heap-buffer-overflow in dwg_encode_STYLE_private() in dwg.spec
https://api.github.com/repos/LibreDWG/libredwg/issues/359/comments
1
2021-06-09T07:55:23Z
2022-02-06T17:26:33Z
https://github.com/LibreDWG/libredwg/issues/359
915,907,191
359
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4, (also in the latest commit 45d2a29) There is heap buffer-overflow in function bit_downconvert_CMC() in bits.c **reproduce** ./configure --enable-release CFLAGS="-fsanitize=address" ./configure --enable-release make ./dwgrewrite [poc] [heap-buffer-overflow-bit_downconvert_CMC.zip](https://github.com/LibreDWG/libredwg/files/6622011/heap-buffer-overflow-bit_downconvert_CMC.zip) ```c AddressSanitizer: heap-buffer-overflow on address 0x60800000067c at pc 0x55afe2904dea bp 0x7ffef0aafa30 sp 0x7ffef0aafa20 READ of size 4 at 0x60800000067c thread T0 #0 0x55afe2904de9 in bit_downconvert_CMC /home/chiba/libredwg-check/src/bits.c:2830 #1 0x55afe2905597 in bit_write_CMC /home/chiba/libredwg-check/src/bits.c:2887 #2 0x55afe4b411a3 in dwg_encode_entity /home/chiba/libredwg-check/src/common_entity_data.spec:176 #3 0x55afe3b48880 in dwg_encode_TEXT /home/chiba/libredwg-check/src/dwg.spec:26 #4 0x55afe4b353cc in dwg_encode_add_object /home/chiba/libredwg-check/src/encode.c:3517 #5 0x55afe3b24eb6 in dwg_encode /home/chiba/libredwg-check/src/encode.c:2352 #6 0x55afe28e078d in dwg_write_file /home/chiba/libredwg-check/src/dwg.c:429 #7 0x55afe28dcf4f in main /home/chiba/libredwg-check/programs/dwgrewrite.c:349 #8 0x7fc7861cc0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #9 0x55afe28dbbad in _start (/home/chiba/libredwg-check/asan-master/bin/dwgrewrite+0x207bad) 0x60800000067c is located 4 bytes to the right of 88-byte region [0x608000000620,0x608000000678) allocated by thread T0 here: #0 0x7fc7865f3dc6 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10ddc6) #1 0x55afe2ec16c5 in dwg_setup_UNKNOWN_OBJ /home/chiba/libredwg-check/src/dwg.spec:7005 #2 0x55afe2ec1cb5 in dwg_decode_UNKNOWN_OBJ /home/chiba/libredwg-check/src/dwg.spec:7005 #3 0x55afe34439b8 in dwg_decode_add_object /home/chiba/libredwg-check/src/decode.c:5900 #4 0x55afe29a635f in read_2004_section_handles /home/chiba/libredwg-check/src/decode.c:2928 #5 0x55afe29fffd0 in decode_R2004 /home/chiba/libredwg-check/src/decode.c:3778 #6 0x55afe2908735 in dwg_decode /home/chiba/libredwg-check/src/decode.c:252 #7 0x55afe28deb78 in dwg_read_file /home/chiba/libredwg-check/src/dwg.c:254 #8 0x55afe28dcb44 in main /home/chiba/libredwg-check/programs/dwgrewrite.c:290 #9 0x7fc7861cc0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-buffer-overflow /home/chiba/libredwg-check/src/bits.c:2830 in bit_downconvert_CMC Shadow bytes around the buggy address: 0x0c107fff8070: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff8080: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff8090: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff80a0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff80b0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa =>0x0c107fff80c0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00[fa] 0x0c107fff80d0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff80e0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff80f0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 fa 0x0c107fff8100: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00 0x0c107fff8110: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 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 Shadow gap: cc ==2245880==ABORTING ```
heap-buffer-overflow in bit_downconvert_CMC in bits.c
https://api.github.com/repos/LibreDWG/libredwg/issues/358/comments
1
2021-06-09T07:52:13Z
2022-02-06T17:40:53Z
https://github.com/LibreDWG/libredwg/issues/358
915,904,559
358
[ "LibreDWG", "libredwg" ]
## 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 remove_NOD_item in src/encode.c:1361. ASAN report: ``` $ ./dwgrewrite ./pocs/tests_64230 ...... ...... ...... ================================================================= ==25781==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000018 (pc 0x000001041b8f bp 0x60e000000120 sp 0x7ffe1389dbb0 T0) ==25781==The signal is caused by a READ memory access. ==25781==Hint: address points to the zero page. #0 0x1041b8f in remove_NOD_item /root/fuzz/45d2a29/src/encode.c:1361:12 #1 0xfe46d5 in fixup_NOD /root/fuzz/45d2a29/src/encode.c #2 0xfc20a3 in dwg_encode /root/fuzz/45d2a29/src/encode.c:1849:21 #3 0x4c8a03 in dwg_write_file /root/fuzz/45d2a29/src/dwg.c:429:11 #4 0x4c605a in main /root/fuzz/45d2a29/programs/dwgrewrite.c:349:11 #5 0x7f3f93b5683f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #6 0x41ba18 in _start (/root/fuzz/dwgrewrite+0x41ba18) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /root/fuzz/45d2a29/src/encode.c:1361:12 in remove_NOD_item ==25781==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64230.zip dwgrewrite ./tests_64230 ``` POC file : [tests_64230.zip](https://github.com/LibreDWG/libredwg/files/6621998/tests_64230.zip)
Null pointer dereference in function remove_NOD_item in encode.c:1361
https://api.github.com/repos/LibreDWG/libredwg/issues/357/comments
2
2021-06-09T07:49:00Z
2022-12-15T15:38:10Z
https://github.com/LibreDWG/libredwg/issues/357
915,901,920
357
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap use after free was discovered in dwg_encode_add_object in src/encode.c:3877. ASAN report: ``` $ ./dwgrewrite ./pocs/tests_64231 ==25674==ERROR: AddressSanitizer: heap-use-after-free on address 0x7f9c6f40599f at pc 0x00000049511f bp 0x7ffc234960f0 sp 0x7ffc234958b8 READ of size 178195 at 0x7f9c6f40599f thread T0 #0 0x49511e in __asan_memmove (/root/fuzz/dwgrewrite+0x49511e) #1 0x1016996 in memmove /usr/include/x86_64-linux-gnu/bits/string3.h:59:10 #2 0x1016996 in dwg_encode_add_object /root/fuzz/45d2a29/src/encode.c:3877:11 #3 0xfc8b60 in dwg_encode /root/fuzz/45d2a29/src/encode.c:2352:16 #4 0x4c8a03 in dwg_write_file /root/fuzz/45d2a29/src/dwg.c:429:11 #5 0x4c605a in main /root/fuzz/45d2a29/programs/dwgrewrite.c:349:11 #6 0x7f9c7f3b283f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #7 0x41ba18 in _start (/root/fuzz/dwgrewrite+0x41ba18) 0x7f9c6f40599f is located 172447 bytes inside of 138439591-byte region [0x7f9c6f3db800,0x7f9c777e23a7) freed by thread T0 here: #0 0x4955ed in free (/root/fuzz/dwgrewrite+0x4955ed) #1 0x4e36c4 in bit_chain_free /root/fuzz/45d2a29/src/bits.c:3043:7 #2 0x130fd7e in dwg_encode_PLANESURFACE /root/fuzz/45d2a29/src/./dwg.spec:8818:1 #3 0x1035f5e in dwg_encode_variable_type /root/fuzz/45d2a29/src/./classes.inc:243:3 previously allocated by thread T0 here: #0 0x495b89 in realloc (/root/fuzz/dwgrewrite+0x495b89) #1 0x4d508b in bit_chain_alloc /root/fuzz/45d2a29/src/bits.c:3026:30 #2 0x4c8a03 in dwg_write_file /root/fuzz/45d2a29/src/dwg.c:429:11 #3 0x4c605a in main /root/fuzz/45d2a29/programs/dwgrewrite.c:349:11 #4 0x7f9c7f3b283f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-use-after-free (/root/fuzz/dwgrewrite+0x49511e) in __asan_memmove Shadow bytes around the buggy address: 0x0ff40de78ae0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78af0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0ff40de78b30: fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ff40de78b80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 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 Shadow gap: cc ==25674==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64231.zip dwgrewrite ./tests_64231 ``` POC file : [tests_64231.zip](https://github.com/LibreDWG/libredwg/files/6621939/tests_64231.zip)
Heap use after free in dwg_encode_add_object in src/encode.c:3877
https://api.github.com/repos/LibreDWG/libredwg/issues/356/comments
2
2021-06-09T07:41:18Z
2023-06-27T10:21:29Z
https://github.com/LibreDWG/libredwg/issues/356
915,895,718
356
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4, (also in the latest commit 45d2a290) There is heap use after free in function bit_read_RC() in bits.c **reproduce** ``` ./configure --enable-release CFLAGS="-fsanitize=address" ./configure --enable-release make ./dwgrewrite [poc] ``` [uaf_read_RC.zip](https://github.com/LibreDWG/libredwg/files/6616813/uaf_read_RC.zip) ```c AddressSanitizer: heap-use-after-free on address 0x7feefc1eb800 at pc 0x55f04fcd05dd bp 0x7ffcfd0c1430 sp 0x7ffcfd0c1420 READ of size 1 at 0x7feefc1eb800 thread T0 #0 0x55f04fcd05dc in bit_read_RC /home/chiba/libredwg-check/src/bits.c:316 #1 0x55f04fce552f in bit_copy_chain /home/chiba/libredwg-check/src/bits.c:3326 #2 0x55f050ef00c6 in obj_flush_hdlstream /home/chiba/libredwg-check/src/encode.c:784 #3 0x55f051a9d1dd in dwg_encode_PLANESURFACE_private /home/chiba/libredwg-check/src/dwg.spec:8832 #4 0x55f051a83183 in dwg_encode_PLANESURFACE /home/chiba/libredwg-check/src/dwg.spec:8818 #5 0x55f051ef41f1 in dwg_encode_variable_type /home/chiba/libredwg-check/src/classes.inc:243 #6 0x55f051f13dd1 in dwg_encode_add_object /home/chiba/libredwg-check/src/encode.c:3771 #7 0x55f050f02eb6 in dwg_encode /home/chiba/libredwg-check/src/encode.c:2352 #8 0x55f04fcbe78d in dwg_write_file /home/chiba/libredwg-check/src/dwg.c:429 #9 0x55f04fcbaf4f in main /home/chiba/libredwg-check/programs/dwgrewrite.c:349 #10 0x7fef0137f0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #11 0x55f04fcb9bad in _start (/home/chiba/libredwg-check/asan-master/bin/dwgrewrite+0x207bad) 0x7feefc1eb800 is located 0 bytes inside of 283648-byte region [0x7feefc1eb800,0x7feefc230c00) freed by thread T0 here: #0 0x7fef017a6ffe in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe) #1 0x55f04fce4409 in bit_chain_alloc /home/chiba/libredwg-check/src/bits.c:3026 #2 0x55f04fce53d8 in bit_copy_chain /home/chiba/libredwg-check/src/bits.c:3314 #3 0x55f050ef00c6 in obj_flush_hdlstream /home/chiba/libredwg-check/src/encode.c:784 #4 0x55f051a9d1dd in dwg_encode_PLANESURFACE_private /home/chiba/libredwg-check/src/dwg.spec:8832 #5 0x55f051a83183 in dwg_encode_PLANESURFACE /home/chiba/libredwg-check/src/dwg.spec:8818 #6 0x55f051ef41f1 in dwg_encode_variable_type /home/chiba/libredwg-check/src/classes.inc:243 #7 0x55f051f13dd1 in dwg_encode_add_object /home/chiba/libredwg-check/src/encode.c:3771 #8 0x55f050f02eb6 in dwg_encode /home/chiba/libredwg-check/src/encode.c:2352 #9 0x55f04fcbe78d in dwg_write_file /home/chiba/libredwg-check/src/dwg.c:429 #10 0x55f04fcbaf4f in main /home/chiba/libredwg-check/programs/dwgrewrite.c:349 #11 0x7fef0137f0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) previously allocated by thread T0 here: #0 0x7fef017a6ffe in __interceptor_realloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dffe) #1 0x55f04fce4409 in bit_chain_alloc /home/chiba/libredwg-check/src/bits.c:3026 #2 0x55f051f12dda in dwg_encode_add_object /home/chiba/libredwg-check/src/encode.c:3490 #3 0x55f050f02eb6 in dwg_encode /home/chiba/libredwg-check/src/encode.c:2352 #4 0x55f04fcbe78d in dwg_write_file /home/chiba/libredwg-check/src/dwg.c:429 #5 0x55f04fcbaf4f in main /home/chiba/libredwg-check/programs/dwgrewrite.c:349 #6 0x7fef0137f0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) SUMMARY: AddressSanitizer: heap-use-after-free /home/chiba/libredwg-check/src/bits.c:316 in bit_read_RC Shadow bytes around the buggy address: 0x0ffe5f8356b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffe5f8356c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffe5f8356d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffe5f8356e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0ffe5f8356f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0ffe5f835700:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ffe5f835710: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ffe5f835720: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ffe5f835730: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ffe5f835740: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0ffe5f835750: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 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 Shadow gap: cc ==434628==ABORTING ```
use after free in bit_read_RC in bits.c
https://api.github.com/repos/LibreDWG/libredwg/issues/355/comments
1
2021-06-08T13:26:33Z
2022-02-06T18:12:50Z
https://github.com/LibreDWG/libredwg/issues/355
915,051,695
355
[ "LibreDWG", "libredwg" ]
## Affected version the latest commit: https://github.com/LibreDWG/libredwg/tree/45d2a290c65ed691be0901ba2b2ef51044e07a16 and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in get_bmp in programs/dwgbmp.c:182. ASAN report: ``` $ ./dwgbmp ./pocs/tests_64219 /dev/null ================================================================= ==17975==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6290000042ef at pc 0x00000043449e bp 0x7ffde9425050 sp 0x7ffde9424818 READ of size 16520 at 0x6290000042ef thread T0 #0 0x43449d in fwrite (/root/fuzz/dwgbmp+0x43449d) #1 0x4c619e in get_bmp /root/fuzz/45d2a29/programs/dwgbmp.c:182:12 #2 0x4c5bcf in main /root/fuzz/45d2a29/programs/dwgbmp.c:301:11 #3 0x7facb795d83f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #4 0x41ba28 in _start (/root/fuzz/dwgbmp+0x41ba28) 0x6290000042ef is located 0 bytes to the right of 16623-byte region [0x629000000200,0x6290000042ef) allocated by thread T0 here: #0 0x4959f2 in calloc (/root/fuzz/dwgbmp+0x4959f2) #1 0x4ebf1d in decode_R13_R2000 /root/fuzz/45d2a29/src/decode.c:1028:36 #2 0x4e48a1 in dwg_decode /root/fuzz/45d2a29/src/decode.c:246:36 #3 0x4c75ec in dwg_read_file /root/fuzz/45d2a29/src/dwg.c:254:11 #4 0x4c5ead in get_bmp /root/fuzz/45d2a29/programs/dwgbmp.c:120:11 #5 0x4c5bcf in main /root/fuzz/45d2a29/programs/dwgbmp.c:301:11 #6 0x7facb795d83f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 SUMMARY: AddressSanitizer: heap-buffer-overflow (/root/fuzz/dwgbmp+0x43449d) in fwrite Shadow bytes around the buggy address: 0x0c527fff8800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c527fff8810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c527fff8820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c527fff8830: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c527fff8840: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c527fff8850: 00 00 00 00 00 00 00 00 00 00 00 00 00[07]fa fa 0x0c527fff8860: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c527fff8870: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c527fff8880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c527fff8890: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c527fff88a0: 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 Shadow gap: cc ==17975==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64219.zip dwgbmp ./tests_64219 ``` POC file : [tests_64219.zip](https://github.com/LibreDWG/libredwg/files/6614957/tests_64219.zip)
Heap-buffer-overflow in get_bmp in programs/dwgbmp.c:182
https://api.github.com/repos/LibreDWG/libredwg/issues/354/comments
2
2021-06-08T08:49:06Z
2022-02-06T18:55:00Z
https://github.com/LibreDWG/libredwg/issues/354
914,610,848
354
[ "LibreDWG", "libredwg" ]
Compile times are getting insane with 16GB RAM. Split out several shared libs of either modules, or object families (as Teigha does). With modules encode/decode split compile-time will still require >10min, only with the dwg.spec splitup it will become managable. so split out dynblocks and maybe acsh solids, surfaces or maybe just upgrade to 32GB RAM (160EUR)
Shorter compile times
https://api.github.com/repos/LibreDWG/libredwg/issues/353/comments
1
2021-06-08T06:48:46Z
2023-07-12T21:20:18Z
https://github.com/LibreDWG/libredwg/issues/353
914,434,539
353
[ "LibreDWG", "libredwg" ]
## Affected version [the latest commit](https://github.com/LibreDWG/libredwg/commit/4c210bbae04957b7d4aba55aee8dca42337f8d47) and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in dwg_section_wtype in dwg.c:1663. ASAN report: ``` ./dwgread ./tests_64206 ================================================================= ==9487==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd7f8d5f78 at pc 0x0000004ce5e4 bp 0x7ffd7f8d5f30 sp 0x7ffd7f8d5f28 WRITE of size 1 at 0x7ffd7f8d5f78 thread T0 #0 0x4ce5e3 in dwg_section_wtype /root/fuzz/libredwg/src/dwg.c:1663:17 #1 0xc85dfc in read_sections_map /root/fuzz/libredwg/src/decode_r2007.c:966:23 #2 0xc83bd6 in read_r2007_meta_data /root/fuzz/libredwg/src/decode_r2007.c:2367:18 #3 0x4f9fcc in decode_R2007 /root/fuzz/libredwg/src/decode.c:3836:11 #4 0x4e49ab in dwg_decode /root/fuzz/libredwg/src/decode.c:248:29 #5 0x4c75cc in dwg_read_file /root/fuzz/libredwg/src/dwg.c:254:11 #6 0x4c5d47 in main /root/fuzz/libredwg/programs/dwgread.c #7 0x7f3d92d0483f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #8 0x41ba58 in _start (/root/fuzz/pocs/dwgread+0x41ba58) Address 0x7ffd7f8d5f78 is located in stack of thread T0 at offset 56 in frame #0 0x4ce3ef in dwg_section_wtype /root/fuzz/libredwg/src/dwg.c:1652 This frame has 1 object(s): [32, 56) 'name' (line 1654) <== Memory access at offset 56 overflows this variable HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork (longjmp and C++ exceptions *are* supported) SUMMARY: AddressSanitizer: stack-buffer-overflow /root/fuzz/libredwg/src/dwg.c:1663:17 in dwg_section_wtype Shadow bytes around the buggy address: 0x10002ff12b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10002ff12ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10002ff12bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10002ff12bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10002ff12bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x10002ff12be0: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00[f3] 0x10002ff12bf0: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 0x10002ff12c00: 00 00 00 00 f1 f1 f1 f1 00 f3 f3 f3 00 00 00 00 0x10002ff12c10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x10002ff12c20: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 0x10002ff12c30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 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 Shadow gap: cc ==9487==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64206.zip dwgread ./tests_64206 ``` POC file : [tests_64206.zip](https://github.com/LibreDWG/libredwg/files/6606924/tests_64206.zip)
stack-buffer-overflow in dwg_section_wtype in dwg.c:1663
https://api.github.com/repos/LibreDWG/libredwg/issues/352/comments
1
2021-06-07T07:54:20Z
2021-06-07T07:57:07Z
https://github.com/LibreDWG/libredwg/issues/352
913,241,734
352
[ "LibreDWG", "libredwg" ]
## Affected version [the latest commit](https://github.com/LibreDWG/libredwg/commit/4c210bbae04957b7d4aba55aee8dca42337f8d47) and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in copy_compressed_bytes in decode_r2007.c:332. ASAN report: ``` ./dwgread ./tests_64205 ERROR: Section[7]->pages[0] overflow Warning: Failed to find section_info[1] ERROR: Failed to read header section Warning: Failed to find section_info[3] ERROR: Failed to read class section Warning: Failed to find section_info[7] ERROR: Failed to read objects section Warning: Failed to find section_info[2] Warning: thumbnail.size mismatch: 185216 != 163880 ERROR: Failed to find page 222 ================================================================= ==9485==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000002e3 at pc 0x000000ca5f2b bp 0x7ffdbc6926d0 sp 0x7ffdbc6926c8 WRITE of size 8 at 0x6020000002e3 thread T0 #0 0xca5f2a in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53:10 #1 0xca5f2a in copy_compressed_bytes /root/fuzz/libredwg/src/decode_r2007.c:332:7 #2 0xca4195 in decompress_r2007 /root/fuzz/libredwg/src/decode_r2007.c:523:7 #3 0xcaa7fe in read_data_page /root/fuzz/libredwg/src/decode_r2007.c:728:13 #4 0xcaa319 in read_data_section /root/fuzz/libredwg/src/decode_r2007.c:811:19 #5 0xc9be6b in read_2007_section_revhistory /root/fuzz/libredwg/src/decode_r2007.c:1945:11 #6 0xc83d65 in read_r2007_meta_data /root/fuzz/libredwg/src/decode_r2007.c:2387:12 #7 0x4f9fcc in decode_R2007 /root/fuzz/libredwg/src/decode.c:3836:11 #8 0x4e49ab in dwg_decode /root/fuzz/libredwg/src/decode.c:248:29 #9 0x4c75cc in dwg_read_file /root/fuzz/libredwg/src/dwg.c:254:11 #10 0x4c5d47 in main /root/fuzz/libredwg/programs/dwgread.c #11 0x7f581684583f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #12 0x41ba58 in _start (/root/fuzz/pocs/dwgread+0x41ba58) 0x6020000002e3 is located 3 bytes to the right of 16-byte region [0x6020000002d0,0x6020000002e0) allocated by thread T0 here: #0 0x495a22 in calloc (/root/fuzz/pocs/dwgread+0x495a22) #1 0xca9e98 in read_data_section /root/fuzz/libredwg/src/decode_r2007.c:774:26 SUMMARY: AddressSanitizer: heap-buffer-overflow /usr/include/x86_64-linux-gnu/bits/string3.h:53:10 in memcpy Shadow bytes around the buggy address: 0x0c047fff8000: fa fa 00 00 fa fa 00 fa fa fa 00 fa fa fa 00 fa 0x0c047fff8010: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 06 fa 0x0c047fff8020: fa fa 04 fa fa fa 04 fa fa fa 04 fa fa fa 04 fa 0x0c047fff8030: fa fa 04 fa fa fa 00 06 fa fa 04 fa fa fa 04 fa 0x0c047fff8040: fa fa 00 00 fa fa 00 00 fa fa 02 fa fa fa 02 fa =>0x0c047fff8050: fa fa 02 fa fa fa 02 fa fa fa 00 00[fa]fa fa fa 0x0c047fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff8090: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c047fff80a0: 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 Shadow gap: cc ==9485==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64205.zip dwgread ./tests_64205 ``` POC file : [tests_64205.zip](https://github.com/LibreDWG/libredwg/files/6606900/tests_64205.zip)
Heap-buffer-overflow in copy_compressed_bytes in decode_r2007.c:332
https://api.github.com/repos/LibreDWG/libredwg/issues/351/comments
1
2021-06-07T07:50:57Z
2021-06-07T19:17:53Z
https://github.com/LibreDWG/libredwg/issues/351
913,238,141
351
[ "LibreDWG", "libredwg" ]
## Affected version [the latest commit](https://github.com/LibreDWG/libredwg/commit/4c210bbae04957b7d4aba55aee8dca42337f8d47) and 0.12.4 ## What's the problem? A heap buffer overflow was discovered in copy_bytes in decode_r2007.c:228. ASAN report: ``` ./dwgread ./tests_64199 ================================================================= ==9330==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62a000005f55 at pc 0x000000ca93c3 bp 0x7ffe5a6134c0 sp 0x7ffe5a6134b8 WRITE of size 1 at 0x62a000005f55 thread T0 #0 0xca93c2 in copy_bytes /root/fuzz/libredwg/src/decode_r2007.c:228:12 #1 0xca431a in decompress_r2007 /root/fuzz/libredwg/src/decode_r2007.c:550:11 #2 0xcaa7fe in read_data_page /root/fuzz/libredwg/src/decode_r2007.c:728:13 #3 0xcaa319 in read_data_section /root/fuzz/libredwg/src/decode_r2007.c:811:19 #4 0xc8bee9 in read_2007_section_handles /root/fuzz/libredwg/src/decode_r2007.c:1622:11 #5 0xc83c84 in read_r2007_meta_data /root/fuzz/libredwg/src/decode_r2007.c:2378:12 #6 0x4f9fcc in decode_R2007 /root/fuzz/libredwg/src/decode.c:3836:11 #7 0x4e49ab in dwg_decode /root/fuzz/libredwg/src/decode.c:248:29 #8 0x4c75cc in dwg_read_file /root/fuzz/libredwg/src/dwg.c:254:11 #9 0x4c5d47 in main /root/fuzz/libredwg/programs/dwgread.c #10 0x7f7541c7483f in __libc_start_main /build/glibc-S7Ft5T/glibc-2.23/csu/../csu/libc-start.c:291 #11 0x41ba58 in _start (/root/fuzz/pocs/dwgread+0x41ba58) 0x62a000005f55 is located 0 bytes to the right of 23893-byte region [0x62a000000200,0x62a000005f55) allocated by thread T0 here: #0 0x495a22 in calloc (/root/fuzz/pocs/dwgread+0x495a22) #1 0xca9e98 in read_data_section /root/fuzz/libredwg/src/decode_r2007.c:774:26 SUMMARY: AddressSanitizer: heap-buffer-overflow /root/fuzz/libredwg/src/decode_r2007.c:228:12 in copy_bytes Shadow bytes around the buggy address: 0x0c547fff8b90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c547fff8ba0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c547fff8bb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c547fff8bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c547fff8bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c547fff8be0: 00 00 00 00 00 00 00 00 00 00[05]fa fa fa fa fa 0x0c547fff8bf0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c547fff8c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c547fff8c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c547fff8c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c547fff8c30: 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 Shadow gap: cc ==9330==ABORTING ``` ## Compile command ``` CC="clang" CFLAGS="-O1 -g -fsanitize=address" ./configure --enable-release --disable-shared && make ``` ## How can we reproduce the issue? ``` unzip tests_64199.zip dwgread ./tests_64199 ``` POC file : [tests_64199.zip](https://github.com/LibreDWG/libredwg/files/6606871/tests_64199.zip)
Heap-buffer-overflow in copy_bytes in decode_r2007.c:228
https://api.github.com/repos/LibreDWG/libredwg/issues/350/comments
1
2021-06-07T07:46:30Z
2021-06-07T18:57:04Z
https://github.com/LibreDWG/libredwg/issues/350
913,233,568
350
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4, (also in the latest commit 4c210bb) There is stack-buffer-overflow in function dwg_section_wtype in dwg.c Size of array `name` is 24 ,but in the while loop at line 1661 , `name` will overflow if `i` is big enough ```c //dwg.c 1654 char name[24]; ... 1661 while ((c = *wp++)) 1662 { 1663 name[i++] = (char)(c & 0xff); 1664 } ──────── threads ──── [#0] Id 1, Name: "dwgread", stopped 0x7ffff7cbd18b in __GI_raise (), reason: SIGABRT ───────── trace ──── [#0] 0x7ffff7cbd18b β†’ __GI_raise(sig=0x6) [#1] 0x7ffff7c9c859 β†’ __GI_abort() [#2] 0x7ffff7d073ee β†’ __libc_message(action=do_abort, fmt=0x7ffff7e3107c "*** %s ***: terminated\n") [#3] 0x7ffff7da9b4a β†’ __GI___fortify_fail(msg=0x7ffff7e31064 "stack smashing detected") [#4] 0x7ffff7da9b16 β†’ __stack_chk_fail() [#5] 0x5555555b003d β†’ dwg_section_wtype(wname=0x5555573491e0) [#6] 0x555555d0ef79 β†’ read_sections_map(dat=0x7fffffffd040, size_comp=0x47f, size_uncomp=0xa14, correction=0x4) [#7] 0x555555d38230 β†’ read_r2007_meta_data(dat=0x7fffffffd040, hdl_dat=0x7fffffffcf80, dwg=0x7fffffffd1c0) [#8] 0x555555632e2d β†’ decode_R2007(dat=0x7fffffffd040, dwg=0x7fffffffd1c0) [#9] 0x5555555bcebd β†’ dwg_decode(dat=0x7fffffffd040, dwg=0x7fffffffd1c0) ────── gef➀ p i $1 = 0x1a ``` reproduce ./configure --enable-release make ./dwgread [poc] [stackoverflow_dwg_section_wtype_1.zip](https://github.com/LibreDWG/libredwg/files/6603086/stackoverflow_dwg_section_wtype_1.zip)
stack-buffer-overflow in function dwg_section_wtype in dwg.c.
https://api.github.com/repos/LibreDWG/libredwg/issues/349/comments
2
2021-06-05T19:13:00Z
2021-06-07T18:56:22Z
https://github.com/LibreDWG/libredwg/issues/349
912,402,258
349
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4, (also in the latest commit 4c210bb) There is overflow in function read_data_section in decode_r2007.c This bug is caused by the following dangerous memcpy calling ```c // decode_r2007.c 821 else 822 { 823 memcpy (&decomp[section_page->offset], &dat->chain[dat->byte], 824 section_page->uncomp_size); 825 } 826 } 827 sec_dat->chain = decomp; ──── threads ──── [#0] Id 1, Name: "dwg2SVG", stopped 0x7ffff7d7595e in __memmove_avx_unaligned_erms (), reason: SIGSEGV ─── trace ──── [#0] 0x7ffff7d7595e β†’ __memmove_avx_unaligned_erms() [#1] 0x555555d10792 β†’ read_data_section(sec_dat=0x555556988e20 <sec_dat>, dat=0x7fffffffd090, sections_map=0x55555698d070, pages_map=0x55555698d740, sec_type=SECTION_PREVIEW) [#2] 0x555555d39987 β†’ read_2007_section_preview(dat=0x7fffffffd090, dwg=0x7fffffffd1a0, sections_map=0x55555698d070, pages_map=0x55555698d740) [#3] 0x555555d3a268 β†’ read_r2007_meta_data(dat=0x7fffffffd090, hdl_dat=0x7fffffffcfd0, dwg=0x7fffffffd1a0) [#4] 0x555555634d2a β†’ decode_R2007(dat=0x7fffffffd090, dwg=0x7fffffffd1a0) [#5] 0x5555555bedba β†’ dwg_decode(dat=0x7fffffffd090, dwg=0x7fffffffd1a0) [#6] 0x5555555adfc0 β†’ dwg_read_file(filename=0x7fffffffe611 "poc", dwg=0x7fffffffd1a0) [#7] 0x5555555acc65 β†’ main(argc=0x2, argv=0x7fffffffe378) ``` ./configure --enable-release make ./bin/dwg2SVG [poc] [heapoverflow_read_data_section_1.zip](https://github.com/LibreDWG/libredwg/files/6603028/heapoverflow_read_data_section_1.zip)
heap-overflow in function read_data_section in decode_r2007.c
https://api.github.com/repos/LibreDWG/libredwg/issues/348/comments
3
2021-06-05T18:36:48Z
2022-02-06T18:39:57Z
https://github.com/LibreDWG/libredwg/issues/348
912,387,404
348
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4, (also in the latest commit 4c210bb) There is null pointer deference in function read_data_section in decode_r2007.c Here need check the validity of `section->pages` before useing. ```c ────── source:decode_r2007.c+790 ──── 785 sec_dat->version = dat->version; 786 sec_dat->from_version = dat->from_version; 787 788 for (i = 0; i < (int)section->num_pages; i++) 789 { // section_page=0x00007fffffffcc20 β†’ 0x00000000ffffd090, section=0x00007fffffffcc08 β†’ [...] β†’ 0x000000000000012c, i=0x0 β†’ 790 r2007_section_page *section_page = section->pages[i]; 791 page = get_page (pages_map, section_page->id); 792 if (page == NULL) 793 { 794 free (decomp); 795 LOG_ERROR ("Failed to find page %d", (int)section_page->id) ──────────── threads ──── [#0] Id 1, Name: "dwg", stopped 0x555555d10522 in read_data_section (), reason: SIGSEGV ─────────────────── trace ──── [#0] 0x555555d10522 β†’ read_data_section(sec_dat=0x7fffffffcd50, dat=0x7fffffffd090, sections_map=0x55555698d070, pages_map=0x55555698d740, sec_type=SECTION_FILEDEPLIST) [#1] 0x555555d2329f β†’ read_2007_section_filedeplist(dat=0x7fffffffd090, dwg=0x7fffffffd1a0, sections_map=0x55555698d070, pages_map=0x55555698d740) [#2] 0x555555d3a2e6 β†’ read_r2007_meta_data(dat=0x7fffffffd090, hdl_dat=0x7fffffffcfd0, dwg=0x7fffffffd1a0) [#3] 0x555555634d2a β†’ decode_R2007(dat=0x7fffffffd090, dwg=0x7fffffffd1a0) [#4] 0x5555555bedba β†’ dwg_decode(dat=0x7fffffffd090, dwg=0x7fffffffd1a0) [#5] 0x5555555adfc0 β†’ dwg_read_file(filename=0x7fffffffe611 "poc", dwg=0x7fffffffd1a0) [#6] 0x5555555acc65 β†’ main(argc=0x2, argv=0x7fffffffe378) ───────────────────── ``` gef➀ p section->pages $1 = (r2007_section_page **) 0x0 **reproduce** ./configure --enable-release --disable-shared make ./dwgread [poc] [nullpointer_read_data_section_1.zip](https://github.com/LibreDWG/libredwg/files/6603016/nullpointer_read_data_section_1.zip)
null pointer deference in function read_data_section in decode_r2007.c
https://api.github.com/repos/LibreDWG/libredwg/issues/347/comments
1
2021-06-05T18:26:05Z
2021-06-07T19:00:33Z
https://github.com/LibreDWG/libredwg/issues/347
912,383,083
347
[ "LibreDWG", "libredwg" ]
With font_file: arial.ttf (EED name "Arial", flag 34).
Broken Text Style write on win64 only
https://api.github.com/repos/LibreDWG/libredwg/issues/346/comments
144
2021-06-03T16:46:20Z
2024-07-05T13:42:17Z
https://github.com/LibreDWG/libredwg/issues/346
910,678,516
346
[ "LibreDWG", "libredwg" ]
Hi, In release version 0.12.4,(also in the latest commit 4c210bba) , dwg2SVG 0.12.4.4317 There is an infinite loop in functopn output_BLOCK_HEADER() in dwg2SVG.c Occur in the while loop at line 804 ```c //dwg2SVG.c 802 while (obj) 803 { 804 num += output_object (obj); 805 obj = get_next_owned_entity (ref->obj, obj); 806 } ``` Root cause is in `dwg_next_entity`. If function `dwg_ref_object_silent ` call `return dwg_ref_object_silent (obj->parent, next);` and then `obj = bj->tio.entity->next_entity->obj`, the loop happened ```c //dwg.c 1803 dwg_next_entity (const Dwg_Object *restrict obj) 1092 { 1093 if (!obj->tio.entity) // decoding error 1094 goto next_obj; 1095 next = obj->tio.entity->next_entity; 1096 if (next && next->absolute_ref) 1097 return dwg_ref_object_silent (obj->parent, next); 1098 else 1099 goto next_obj; 1100 } $57 = (const Dwg_Object * restrict) 0x7fffeeb3ea88 gef➀ p obj->tio.entity $58 = (Dwg_Object_Entity *) 0x6120000031c0 gef➀ p obj->tio.entity->next_entity $59 = (BITCODE_H) 0x6040000073d0 gef➀ p obj->tio.entity->next_entity->obj $60 = (struct _dwg_object *) 0x7fffeeb3ea88 ``` **reproduce** ./configure --enable-release make ./bin/dwg2SVG [poc] [zipped poc](https://github.com/LibreDWG/libredwg/files/6582616/infinite_loop_dwg_next_entity.zip)
Infinite loop in functopn output_BLOCK_HEADER() in dwg2SVG.c
https://api.github.com/repos/LibreDWG/libredwg/issues/345/comments
1
2021-06-02T07:08:02Z
2022-11-23T09:15:22Z
https://github.com/LibreDWG/libredwg/issues/345
909,190,632
345
[ "LibreDWG", "libredwg" ]
Hello, Running `make check` fails for me on a Gentoo Linux system with version 0.12.4. ``` PASS: alive.test Reading DWG file ../test/test-data/2000/PolyLine2D.dwg Writing DXF file ../PolyLine2D_2000.dxf Reading DWG file ../test/test-data/example_r14.dwg Writing DXF file ../example_r14.dxf Reading DWG file ../test/test-data/example_2000.dwg Writing DXF file ../example_2000.dxf Reading DWG file ../test/test-data/example_2004.dwg Writing DXF file ../example_2004.dxf Reading DWG file ../test/test-data/example_2007.dwg Writing DXF file ../example_2007.dxf Reading DWG file ../test/test-data/example_2010.dwg Writing DXF file ../example_2010.dxf Reading DWG file ../test/test-data/example_2013.dwg Writing DXF file ../example_2013.dxf Reading DWG file ../test/test-data/example_2018.dwg Writing DXF file ../example_2018.dxf ../sample_2000.dxf ACDBDICTIONARYWDFLT ok ../sample_2000.dxf ACDBPLACEHOLDER ok ../sample_2000.dxf LAYOUT ok ../sample_2018.dxf ACDBDICTIONARYWDFLT ok ../sample_2018.dxf ACDBPLACEHOLDER ok ../sample_2018.dxf LAYOUT ok ../example_2000.dxf ACDBPERSSUBENTMANAGER ok ../example_2000.dxf ACDBASSOCDEPENDENCY ok ../example_2004.dxf ACDBPERSSUBENTMANAGER ok ../example_2004.dxf ACDBASSOCDEPENDENCY ok ../example_2007.dxf ACDBPERSSUBENTMANAGER ok ../example_2007.dxf ACDBASSOCDEPENDENCY ok ../example_2010.dxf ACDBPERSSUBENTMANAGER ok ../example_2010.dxf ACDBASSOCDEPENDENCY ok ../example_2013.dxf ACDBPERSSUBENTMANAGER ok ../example_2013.dxf ACDBASSOCDEPENDENCY ok ../example_2018.dxf ACDBPERSSUBENTMANAGER ok ../example_2018.dxf ACDBASSOCDEPENDENCY ok ../Underlay_2004.dxf PDFDEFINITION ok ../Underlay_2004.dxf PDFUNDERLAY ok ../example_2000.dxf pline order ok ../example_2004.dxf pline order ok ../example_2007.dxf pline order ok ../example_2010.dxf pline order ok ../example_2013.dxf pline order ok ../example_2018.dxf pline order ok ../example_2000.dxf insert order ok ../example_2004.dxf insert order ok ../example_2007.dxf insert order ok ../example_2010.dxf insert order ok ../example_2013.dxf insert order ok ../example_2018.dxf insert order ok example_2000.dxf roundtrip fail: expect 259, got 262 entities --- example_2000.log1.tmp 2021-05-24 08:19:52.247668390 -0000 +++ example_2000.log2.tmp 2021-05-24 08:19:52.250668354 -0000 -WIPEOUT +POINT -WIPEOUT +POINT example_2004.dxf roundtrip fail: expect 259, got 262 entities --- example_2004.log1.tmp 2021-05-24 08:19:53.026659145 -0000 +++ example_2004.log2.tmp 2021-05-24 08:19:53.038659003 -0000 -WIPEOUT +POINT -WIPEOUT +POINT example_2007.dxf roundtrip fail: expect 259, got 262 entities --- example_2007.log1.tmp 2021-05-24 08:19:54.098646424 -0000 +++ example_2007.log2.tmp 2021-05-24 08:19:54.107646317 -0000 -WIPEOUT +POINT -WIPEOUT +POINT example_2010.dxf roundtrip fail: expect 259, got 262 entities --- example_2010.log1.tmp 2021-05-24 08:19:55.147633978 -0000 +++ example_2010.log2.tmp 2021-05-24 08:19:55.154633894 -0000 +TABLE -WIPEOUT +POINT -TABLE -WIPEOUT +POINT example_2013.dxf roundtrip fail: expect 259, got 262 entities --- example_2013.log1.tmp 2021-05-24 08:19:56.048623288 -0000 +++ example_2013.log2.tmp 2021-05-24 08:19:56.052623241 -0000 +TABLE -WIPEOUT +POINT -TABLE -WIPEOUT +POINT example_2018.dxf roundtrip fail: expect 259, got 262 entities --- example_2018.log1.tmp 2021-05-24 08:19:57.011611864 -0000 +++ example_2018.log2.tmp 2021-05-24 08:19:57.015611816 -0000 +TABLE -WIPEOUT +POINT -TABLE -WIPEOUT +POINT dxf.test: 6 failures ls: cannot access './*dxf.log': No such file or directory FAIL: dxf.test ================================= 1 of 2 tests failed Please report to [email protected] ================================= ``` Please let me know if you need any additional information.
dxf.test fails, roundtrip fail: expect 259, got 262 entities
https://api.github.com/repos/LibreDWG/libredwg/issues/342/comments
4
2021-05-24T08:27:28Z
2024-02-26T15:18:59Z
https://github.com/LibreDWG/libredwg/issues/342
899,435,592
342
[ "LibreDWG", "libredwg" ]
![image](https://user-images.githubusercontent.com/29654121/118241022-3deae900-b4ce-11eb-964e-2801c04d403d.png) I tried to add color in geojson but sometimes it did not work. Especially when obj->tio.entity->color.index == 256.
how can i get the color &weigth for entitys in geojson
https://api.github.com/repos/LibreDWG/libredwg/issues/341/comments
1
2021-05-14T08:18:05Z
2021-05-19T01:55:30Z
https://github.com/LibreDWG/libredwg/issues/341
891,720,732
341
[ "LibreDWG", "libredwg" ]
Failed to convert DWG to any format (JSON, dxf, SVG). this started happing after updating to the new release. `Warning: checksum: 0x273e1245 (calculated) mismatch ERROR: Skip section AcDb:AppInfoHistory with max decompression size 0x980 > 0x580 ERROR: Skip section AcDb:SummaryInfo with max decompression size 0x100 > 0x80 ERROR: Invalid section AcDb:SummaryInfo count or max decompression size. Sections: 1, Max size: 0 ERROR: Failed to read uncompressed SummaryInfo section Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 51/33 in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 126/7E in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 243/F3 in 20270 objects Warning: Object handle not found, 1/1 in 20270 objects Warning: Object handle not found, 10145/27A1 in 20270 objects Warning: Object handle not found, 21/15 in 20270 objects Warning: Object handle not found, 193/C1 in 20270 objects Warning: Object handle not found, 35/23 in 20270 objects Warning: Object handle not found, 221/DD in 20270 objects Warning: Object handle not found, 15143/3B27 in 20270 objects Warning: Object handle not found, 108/6C in 20270 objects Warning: Object handle not found, 16130/3F02 in 20270 objects Warning: Object handle not found, 208/D0 in 20270 objects Warning: Object handle not found, 172/AC in 20270 objects Warning: Object handle not found, 9347/2483 in 20270 objects Warning: Object handle not found, 169/A9 in 20270 objects Warning: Object handle not found, 225/E1 in 20270 objects ERROR: Failed to decode file: CSL11-P0071098500-2020-04-01-DE-2_2013.DWG 0xf7`
ERROR: Failed to decode file: xyz.DWG 0xf7
https://api.github.com/repos/LibreDWG/libredwg/issues/338/comments
1
2021-05-08T18:53:25Z
2021-05-14T06:10:20Z
https://github.com/LibreDWG/libredwg/issues/338
881,175,905
338
[ "LibreDWG", "libredwg" ]
Hello! I've found that `dwgfilter` is no longer in the program list and figured that `dwggrep` should be a replacement for it, then. How would one query all geometry types in a dwg file e.g. Polyline, Polygon, MText, etc.? If there's a better tool to help me achieve this, please advise. So far I've been successful in converting the dwg to dxf and querying the dxf file using `ogrinfo`. This seems like an unnecessary overhead since we're able to read the dwg file directly.
Using dwggrep to find all distinct geometry types (or subclasses) in dwg
https://api.github.com/repos/LibreDWG/libredwg/issues/337/comments
5
2021-04-21T06:29:07Z
2021-05-14T06:11:07Z
https://github.com/LibreDWG/libredwg/issues/337
863,495,237
337
[ "LibreDWG", "libredwg" ]
Hello!
Using dwggrep to find all distinct geometry types (or subclasses) in dwg
https://api.github.com/repos/LibreDWG/libredwg/issues/336/comments
0
2021-04-21T06:26:55Z
2021-04-21T06:31:48Z
https://github.com/LibreDWG/libredwg/issues/336
863,493,907
336
[ "LibreDWG", "libredwg" ]
I get the UCS_Control from the dwg_data and dont know what to do next. I'm really looking forward to some help.
I'm new to the project, could you please tell me how to read the UserCoordinateSystem of a dwg?
https://api.github.com/repos/LibreDWG/libredwg/issues/335/comments
3
2021-04-16T17:12:29Z
2021-04-17T15:05:56Z
https://github.com/LibreDWG/libredwg/issues/335
860,008,697
335
[ "LibreDWG", "libredwg" ]
I see this error when building libredwg for conda-forge packages (osx): ``` 2021-04-13T20:20:06.5966890Z ld: -stack_size option can only be used when linking a main executable 2021-04-13T20:20:06.5968550Z clang-11: error: linker command failed with exit code 1 (use -v to see invocation) ```
12.4: conda: osx: linker error
https://api.github.com/repos/LibreDWG/libredwg/issues/334/comments
2
2021-04-13T20:32:52Z
2021-04-14T11:28:48Z
https://github.com/LibreDWG/libredwg/issues/334
857,300,021
334
[ "LibreDWG", "libredwg" ]
I got a error When I am using cmake: CMake Error at CMakeLists.txt:226 (install): install TARGETS given no LIBRARY DESTINATION for shared library target "redwg".
CMake Erro
https://api.github.com/repos/LibreDWG/libredwg/issues/333/comments
3
2021-04-09T05:27:12Z
2022-11-14T09:19:25Z
https://github.com/LibreDWG/libredwg/issues/333
854,173,932
333
[ "LibreDWG", "libredwg" ]
All is in the title : is there any time expectation for this feature ? Best Regards
Any expectation for dwgwrite from GeoJSON
https://api.github.com/repos/LibreDWG/libredwg/issues/332/comments
9
2021-04-08T13:27:43Z
2023-12-27T13:39:30Z
https://github.com/LibreDWG/libredwg/issues/332
853,473,921
332
[ "LibreDWG", "libredwg" ]
I exported DWG to SVG and found that it lost the original color
The exported SVG lost its original color
https://api.github.com/repos/LibreDWG/libredwg/issues/331/comments
3
2021-04-08T03:43:59Z
2021-04-14T10:04:08Z
https://github.com/LibreDWG/libredwg/issues/331
853,028,226
331