[Top][All Lists]

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

Re: [libredwg] bugs

From: Felipe Sanches
Subject: Re: [libredwg] bugs
Date: Tue, 24 Nov 2015 12:38:50 -0200


Is there anyone here who can commit this fix to our current codebase?

On Mon, Nov 23, 2015 at 9:56 PM, Dirk Kretschmann <address@hidden> wrote:

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]