Skip to content
Permalink
Browse files Browse the repository at this point in the history
free: protect freeing obj->dxfname
dont set INDXF when HANDSEED is missing.
e.g. GH #178 null_pointer2 testcase
  • Loading branch information
rurban committed Dec 31, 2019
1 parent 7a6d8ce commit 3b837bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion programs/dwgrewrite.c
Expand Up @@ -197,7 +197,7 @@ main (int argc, char *argv[])
i = optind;

memset (&dwg, 0, sizeof (Dwg_Data));
dwg.opts = opts;
dwg.opts = opts & 0xf;

filename_in = argv[i];
if (!filename_in)
Expand Down
2 changes: 1 addition & 1 deletion src/encode.c
Expand Up @@ -2420,7 +2420,7 @@ dwg_encode_header_variables (Bit_Chain *dat, Bit_Chain *hdl_dat,

if (!_obj->HANDSEED) // minimal or broken DXF
{
dwg->opts |= (DWG_OPTS_MINIMAL | DWG_OPTS_INDXF);
dwg->opts |= DWG_OPTS_MINIMAL;
dat->from_version = dat->version - 1;
LOG_TRACE ("encode from minimal DXF\n");
_obj->HANDSEED = calloc(1, sizeof(Dwg_Object_Ref));
Expand Down

0 comments on commit 3b837bb

Please sign in to comment.