Opened 7 years ago

Closed 6 years ago

#1914 closed defect (fixed)

Possible infinite loop in v.in.dxf (present in 6.4.3RC2)

Reported by: RikSaunderson Owned by: hcho
Priority: minor Milestone: 6.4.3
Component: Vector Version: 6.4.3 RCs
Keywords: DXF, infiinte loop Cc:
CPU: Unspecified Platform: All

Description

Hi there,

In the file dxf_to_vect.c, which is part of v.in.dxf, there is a potential infinite loop. The code is as follows (lines 23-29, in function int dxf_to_vect(struct dxf_file *dxf, struct Map_info *Map)):

while (code != 0) {

if (code == -2) /* EOF */

return -1;

/* only looking for header groups (code == 9) */

if (code != 9)

continue;

...

value of code is modified down here

}

This snippet is looking for the Id of a header section of a DXF file. An Id of 9 denotes the header of the file, other Ids represent other things.

If a corrupted DXF file is input, or a completely different type of file which is not a DXF file but superficially looks like one, then this could result in an infinite loop. If the value of code is, for example, 5 the first time we enter this loop, then the loop will never terminate.

Change History (4)

comment:1 Changed 7 years ago by hcho

Owner: changed from grass-dev@… to hcho
Status: newassigned

comment:2 Changed 7 years ago by hcho

Resolution: fixed
Status: assignedclosed

Fixed in trunk r55641 and r55642.

comment:3 in reply to:  2 Changed 7 years ago by neteler

Resolution: fixed
Status: closedreopened

Fixed in trunk r55641 and r55642.

There is furthermore also r55644. Reopening since backport is needed.

comment:4 Changed 6 years ago by hcho

Resolution: fixed
Status: reopenedclosed

Fixed in develbranch_6 (r58720) and releasebranch_6_4 (r58721).

Note: See TracTickets for help on using tickets.