From 12e40b759568b3fb99eacce640cde761416a675e Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 26 Mar 2006 14:29:53 +0000 Subject: [PATCH] potential bufferoverflow throught large windir avoided git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@780 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index 6dbece36..6fc877c1 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -2934,8 +2934,8 @@ rrd_graph_init(image_desc_t *im) windir = getenv("windir"); /* %windir% is something like D:\windows or C:\winnt */ if (windir != NULL) { - strncpy(rrd_win_default_font,windir,999); - rrd_win_default_font[999] = '\0'; + strncpy(rrd_win_default_font,windir,500); + rrd_win_default_font[500] = '\0'; strcat(rrd_win_default_font,"\\fonts\\"); strcat(rrd_win_default_font,RRD_DEFAULT_FONT); for(i=0;i