Code

potential bufferoverflow throught large windir avoided
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 26 Mar 2006 14:29:53 +0000 (14:29 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 26 Mar 2006 14:29:53 +0000 (14:29 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@780 a5681a0c-68f1-0310-ab6d-d61299d08faa

src/rrd_graph.c

index 6dbece3612d84421b2ff20b274c4cbad6b27077b..6fc877c1b952211631e9d796a18cb979787b06eb 100644 (file)
@@ -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<DIM(text_prop);i++){