From: oetiker Date: Sun, 26 Mar 2006 14:29:53 +0000 (+0000) Subject: potential bufferoverflow throught large windir avoided X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6eef1b95472a8d5986ab05bf6636b9a1be02820e;p=rrdtool.git potential bufferoverflow throught large windir avoided git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@780 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 6dbece3..6fc877c 100644 --- a/src/rrd_graph.c +++ b/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