[GRASS-dev] Limit in g.message? was: Limit in number of "variables" for r.mapcalc?

Glynn Clements glynn at gclements.plus.com
Tue Apr 28 14:41:15 PDT 2015


Markus Neteler wrote:

> > But more significantly, G_message() etc use an internal buffer of 2000
> > bytes. A message longer than that probably won't work and may well
> > cause the g.message to crash.
> 
> How about (ab)using GPATH_MAX (include/gis.h) which is 4096 chars long
> and using it in
> general/g.message/main.c as well to avoid a buffer overflow?

Having g.message limit the length of a message would work for
g.message.

For G_message() etc, using vsnprintf() would work, but that's C99.

G_vasprintf() should work, but our private implementation (used if
asprintf() doesn't exist) also requires C99.

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


More information about the grass-dev mailing list