[GRASS-SVN] r72208 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Feb 5 04:51:55 PST 2018
Author: mmetz
Date: 2018-02-05 04:51:55 -0800 (Mon, 05 Feb 2018)
New Revision: 72208
Modified:
grass/trunk/lib/gis/error.c
Log:
libgis: use G_vasprintf() to avoid buffer overflow
Modified: grass/trunk/lib/gis/error.c
===================================================================
--- grass/trunk/lib/gis/error.c 2018-02-04 00:28:40 UTC (rev 72207)
+++ grass/trunk/lib/gis/error.c 2018-02-05 12:51:55 UTC (rev 72208)
@@ -72,11 +72,12 @@
static void vfprint_error(int type, const char *template, va_list ap)
{
- char buffer[2000]; /* G_asprintf does not work */
+ char *buffer = NULL;
- vsprintf(buffer, template, ap);
+ G_vasprintf(&buffer, template, ap);
print_error(buffer, type);
+ G_free(buffer);
}
/*!
More information about the grass-commit
mailing list