[GRASS5] [bug #1249] (grass) m.proj2 - char *proj_name doesn't point to any memory

Request Tracker grass-bugs at intevation.de
Wed Aug 28 02:50:05 EDT 2002


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

Subject: m.proj2 - char *proj_name doesn't point to any memory

Platform: GNU/Linux/i386
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 5.0 HEAD

The man page for m.proj2 describes it's arguments as name=..., but it really gives preference to proj=...  That is, the abbreviation vs. the long name.  Furthermore, there is a bug regarding the parsing of name=, where an attempt to sscanf(..., "name=%s", proj_name) is made.  However, proj_name never points at any valid memory, and "%s" splits on whitespace, so a name like 'Lambert Conformal Conic' would be parsed as 'Lambert', iff there was memory allocated.  All in all, it's not clear what's supposed to be going on with the "name" parameter when the abbreviated "proj" is what is really wanted.  I changed proj_name to be NULL, which with my C library means sprintf() just fails, and then the program exits with an error.  With other libraries, the program would probably crash.  IMHO, the program should just use proj=<abbr> and be clear about it in the manual.

 On a related note, the parameter parsing also will generate two +proj=<foo> for the argument list to the projection routines.  Doesn't really hurt anything...


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




More information about the grass-dev mailing list