2010-07-27
2010-07-27 16:46:06 by Martin Stjernholm <mast@lysator.liu.se>
-
ddc1a3e385faa982e73099884ab0f6b1b242561a
(11 lines)
(+6/-5)
[
Show
| Annotate
]
Branch: 7.9
Fixed several cases of unsafe use of get_all_args for optional args.
Rev: src/builtin_functions.c:1.704
Rev: src/cpp.c:1.178
Rev: src/modules/Gettext/gettext.c:1.28
Rev: src/modules/Image/font.c:1.92
Rev: src/modules/_Roxen/roxen.c:1.56
Rev: src/modules/files/socket.c:1.112
Rev: src/modules/files/udp.c:1.84
Rev: src/post_modules/GTK2/source/gnomecanvas.pre:1.8
Rev: src/post_modules/GTK2/source/gtksourceiter.pre:1.7
Rev: src/post_modules/GTK2/source/gtktextiter.pre:1.14
2:
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
- || $Id: font.c,v 1.91 2008/05/04 00:34:22 nilsson Exp $
+ || $Id: font.c,v 1.92 2010/07/27 16:46:05 mast Exp $
*/
#include "global.h"
310:
size_t mmaped_size = 0;
#endif
size_t size = 0;
- char *filename;
+ char *filename = NULL;
get_all_args("Image.Font->load()", args, ".%s", &filename);
- if (!args)
+ if (!filename)
{
fh = (struct file_head *)image_default_font;
size = IMAGE_DEFAULT_FONT_SIZE;
408:
new_font=malloc(sizeof(struct font)+
sizeof(struct _char)*(num_chars-1));
if(!new_font) {
- if (args) {
+ if (filename) {
#ifdef HAVE_MMAP
if (mmaped_size)
munmap((void *)fh, mmaped_size);
470: Inside #if defined(FONT_DEBUG)
#ifdef FONT_DEBUG
else fprintf(stderr,"FONT wrong cookie\n");
#endif
- if (args) {
+ if (filename) {
#ifdef HAVE_MMAP
if (mmaped_size)
munmap((void *)fh, mmaped_size);