diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2004-07-25 17:06:29 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2004-07-25 17:06:29 +0000 |
commit | c8ee056455a1b006a49786c640f0ec60846535c6 (patch) | |
tree | 156b1fdb3a305aa33526b55af952c4d8016954d9 | |
parent | 0e1a7f3845c53c459f61d3b9f41f086053cc88c2 (diff) | |
download | xine-lib-c8ee056455a1b006a49786c640f0ec60846535c6.tar.gz xine-lib-c8ee056455a1b006a49786c640f0ec60846535c6.tar.bz2 |
protect buffers
CVS patchset: 6846
CVS date: 2004/07/25 17:06:29
-rw-r--r-- | misc/xine-fontconv.c | 5 |
1 files changed, 3 insertions, 2 deletions
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' |