libredwg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libredwg] bugs


From: Dirk Kretschmann
Subject: [libredwg] bugs
Date: Tue, 24 Nov 2015 00:56:14 +0100

Hi!

in decode.c, macros DWG_ENTITY and DWG_OBJECT, line 231 and line 250 you have
calloc (sizeof (foo), 1) which should be calloc (1, sizeof (foo))

in dwg.spec, function decode_3dsolid, line 1271/1272 you have
FIELD_VALUE(sat_data) = (BITCODE_RC**) realloc(FIELD_VALUE(sat_data), i * sizeof(BITCODE_RC*));
FIELD_VALUE(block_size) = (BITCODE_BL*) realloc(FIELD_VALUE(block_size), i * sizeof(BITCODE_BL));
the problem is in line 1256 you initialize i = 0 so the memory you are trying to write to after that is not valid. It should be
FIELD_VALUE(sat_data) = (BITCODE_RC**) realloc(FIELD_VALUE(sat_data), (i+1) * sizeof(BITCODE_RC*));
FIELD_VALUE(block_size) = (BITCODE_BL*) realloc(FIELD_VALUE(block_size), (i+1) * sizeof(BITCODE_BL));

Keep up the good work!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]