Skip to content

Commit

Permalink
Allow parsing long GISDBASE paths (#1376)
Browse files Browse the repository at this point in the history
Use a larger buffer when parsing the `.gisrc` file. Use `GPATH_MAX` to fit whatever would fit in the path value, plus the length of the key.

Fixes #1373.
  • Loading branch information
attilaolah authored and neteler committed Mar 1, 2021
1 parent c2e3c00 commit ca0e87b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gis/env.c
Expand Up @@ -115,8 +115,10 @@ void G__read_gisrc_env(void)
}

static void parse_env(FILE *fd, int loc)
{
char buf[200];
{
/* Account for long lines up to GPATH_MAX.
E.g. "GISDBASE: GPATH_MAX\n\0" */
char buf[GPATH_MAX + 16];
char *name;
char *value;

Expand Down

0 comments on commit ca0e87b

Please sign in to comment.