From c8ee056455a1b006a49786c640f0ec60846535c6 Mon Sep 17 00:00:00 2001 From: Michael Roitzsch Date: Sun, 25 Jul 2004 17:06:29 +0000 Subject: protect buffers CVS patchset: 6846 CVS date: 2004/07/25 17:06:29 --- misc/xine-fontconv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'misc') diff --git a/misc/xine-fontconv.c b/misc/xine-fontconv.c index 0735e943c..67717c883 100644 --- a/misc/xine-fontconv.c +++ b/misc/xine-fontconv.c @@ -363,7 +363,7 @@ void render_font (FT_Face face, char *fontname, int size, int thickness, * generate filename, open file */ - sprintf (filename, "%s-%d.xinefont.gz", fontname, size); + snprintf (filename, sizeof(filename), "%s-%d.xinefont.gz", fontname, size); fp = gzopen(filename,"w"); @@ -376,7 +376,8 @@ void render_font (FT_Face face, char *fontname, int size, int thickness, * set up font */ - strcpy(font.name, fontname); + strncpy(font.name, fontname, sizeof(font.name)); + font.name[sizeof(font.name) - 1] = '\0'; /* changes from version 1 to version 2: * 'code' in characters is defined as little endian 16-bit unicode * characters are sorted by 'code' -- cgit v1.2.3