Opened 12 years ago
Closed 11 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 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
follow-up: 3 comment:2 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 12 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in trunk r55641 and r55642.