[GRASS5] [bug #3140] (grass) g.parser: SegFault

this bug's URL: http://intevation.de/rt/webrt?serial_num=3140
-------------------------------------------------------------------------

Subject: g.parser: SegFault

I get a seg fault from the g.parser module if I have a stray
#%option

in the script before the call to g.parser.

Obviously wrong syntax, but maybe it should fail in a more graceful manner...

Hamish

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=3140

Subject: g.parser: SegFault

I get a seg fault from the g.parser module if I have a stray
#%option

in the script before the call to g.parser.

What do you mean by "stray"? Without a "%key:" line?

Obviously wrong syntax, but maybe it should fail in a more graceful manner...

My guess is that G_parser() dereferences the "key" field without
checking that it is non-NULL.

I suspect there are probably other ways in which you can construct
options which G_parser() won't like. I'm not sure how practical it is
to fix this in g.parser rather than G_parser() itself.

--
Glynn Clements <glynn@gclements.plus.com>

> this bug's URL: http://intevation.de/rt/webrt?serial_num=3140

> Subject: g.parser: SegFault
>
> I get a seg fault from the g.parser module if I have a stray
> #%option
>
> in the script before the call to g.parser.

What do you mean by "stray"? Without a "%key:" line?

Without #%end even. I commented out an option but missed the first line.
Thus just a #%option line by itself before the g.parser call.

> Obviously wrong syntax, but maybe it should fail in a more graceful
> manner...

My guess is that G_parser() dereferences the "key" field without
checking that it is non-NULL.

I suspect there are probably other ways in which you can construct
options which G_parser() won't like. I'm not sure how practical it is
to fix this in g.parser rather than G_parser() itself.

Suggested priority = low.

Hamish