[GRASS5] [bug #1052] (grass) [rsv].proj are crashing

Eric G. Miller egm2 at jps.net
Fri May 24 03:19:19 EDT 2002


On Wed, May 22, 2002 at 11:22:15AM +0200, Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=1052
> -------------------------------------------------------------------------
> 
> Subject: [rsv].proj are crashing
> 
> grass binary for platform: Compiled from Sources
> 
> A critical bug report:
> 
> v.proj  in=austria loca=europa mapset=europa
> Segmentation fault (core dumped)
> 
> Also r.proj (and eventually s.proj, untested) are affected.
> 
> I have spent some time in src/libes/gis/env.c where the crash occurs
> in line 195 of get_env() function. The reason is unclear to me why
> strcmp() crashes sometimes (maybe someone else understands the
> problem).
> 
> This should be fixed before pre5.

r.proj at least does these dubious thing:

   strncpy (in_datum, G_database_datum_name(), sizeof(in_datum));
   strncpy (in_ellipse, G_database_ellipse_name(), sizeof(in_ellipse));

Since both the datum and ellipse functions can return NULL, strncpy
will invoke undefined behavior in those cases.  For me, the segfault
in r.proj disappears, by handling these better.

Now, if I can figure out why "1" is returned as the projection name for
UTM...

-- 
Eric G. Miller <egm2 at jps.net>



More information about the grass-dev mailing list