[GRASS5] Segfault in v.in.tig.lndmk

Markus Neteler neteler at itc.it
Fri Feb 15 08:42:28 EST 2002


Thank, Tom!

I have applied the fix to both experimental and release branch.

Markus

On Thu, Feb 14, 2002 at 02:47:41PM -0500, Tom Rake wrote:
> Grass Developers,
> 
> I found a Segfault in v.in.tig.lndmk. Here is a summary of my fault case and 
> a patch that fixed this for me.
> 
> My distro and grass source
> 
> Debian/GNU Linux; grass CVS HEAD; (I believe the release branch should also 
> have same fault - have not tested this ).
> 
> Data used for fault case:
> 
> http://www.census.gov/geo/www/tiger/tiger2k/ny/tgr36105.zip
> 
> Setup this location:
> 
> location: sullivan
> mapset: census
> UTM zone 18
> 
> n=4805100
> s=4440000
> w=279100
> e=743900
> nsres=100
> ewres=100
> 
> Make this file *fault.txt*
> 
> .points hospitality
> D27
> .end
> 
> .exit
> ***** End of fault.txt
> 
> Run this grass command
> 
> v.in.tig.lndmk t1=/dir/to/unziped/TGR36105.RT1 input=crash.txt
> 
> My Analysis
> 
> the Site_head info struct in open_site_file() from points.c failed to fully 
> initialize the structure. The info.stime if non null garbage is taken by 
> G_site_put_head() to me a valid structure.
> 
> This Patch fully initializes the structure to NULLs.
> 
> RCS file: 
> /home/grass/grassrepository/grass/src/mapdev/v.in.tig.lndmk/points.c,v
> retrieving revision 1.2
> diff -c -r1.2 points.c
> *** points.c	12 Jan 2001 08:16:28 -0000	1.2
> --- points.c	14 Feb 2002 19:20:25 -0000
> ***************
> *** 42,47 ****
> --- 42,53 ----
>     FILE *fp1;
>     Site_head info;
> 
> +   info.name = NULL;
> +   info.desc = NULL;
> +   info.form = NULL;
> +   info.labels = NULL;
> +   info.stime = NULL;
> +   info.time = NULL;
>     if (sitefile == NULL)
>     {
>       if ((sitefile = G_fopen_sites_new (site_name)) == NULL)
> 
> 
> 
> -Tom Rake



More information about the grass-dev mailing list