[GRASS5] Re: NVIZ + CELL map + gcc >=3.2.2 = SegFault
Markus Neteler
neteler at itc.it
Thu Sep 18 07:26:00 EDT 2003
Concerning this patch: Should it be applied to 5.0.3 or not?
If yes, I'll prepare a 5.0.3RC4, otherwise we should release
5.0.3RC3.
Markus
On Wed, Sep 17, 2003 at 10:11:09PM +1200, Hamish wrote:
> Bug #2: (got it.)
>
[...]
>
> In src/libes/ogsf/GS2.c's GS_load_att_map(), the 'mapset' variable is
> used uninitialized if "reuse" is true.
>
> Moving the 'mapset=xxxx;' bit out of the condition to about line 1257
> just before 'if (reuse)' stops the segfault; see the attached patch.
>
> Could someone please test & commit to CVS if it's good, as I'll be out
> of town until next week & won't be able to.
>
> Looks ok, but I'm not really sure how much "reuse" reuses.. no chance of
> using the wrong mapset from a previous call is there? That would be a
> very ugly bug to catch.
>
>
>
> forwards in all directions,
> Hamish
> --- src/libes/ogsf/GS2.c.ORIG 2002-08-13 09:45:19.000000000 +1200
> +++ src/libes/ogsf/GS2.c 2003-09-17 21:55:09.000000000 +1200
> @@ -1254,6 +1254,9 @@
> begin = 0;
> }
>
> + /* Get MAPSET to ensure names are fully qualified */
> + mapset = G_find_cell2 (filename, "");
> +
> if (reuse)
> {
> gs->att[att].hdata = hdata;
> @@ -1290,8 +1293,6 @@
>
> tbuff = gs_get_att_typbuff(gs, att, 1);
>
> - /* Get MAPSET to ensure names are fully qualified */
> - mapset = G_find_cell2 (filename, "");
> filename = G_fully_qualified_name(filename, mapset);
>
> /* TODO: Provide mechanism for loading certain attributes at
--
Markus Neteler <neteler at itc.it> http://mpa.itc.it
ITC-irst, Istituto per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy
More information about the grass-dev
mailing list