aboutsummaryrefslogtreecommitdiffstats
path: root/libwc/charset.c
diff options
context:
space:
mode:
authorScarlett <scarlett@xavin.net>2015-01-15 10:38:11 +0000
committerTatsuya Kinoshita <tats@debian.org>2015-01-15 10:38:11 +0000
commitcbec7032ee36346649fc5ebecc4b1c01f01178f1 (patch)
tree69907176f0aed9cef693dbbfd0398fa561c4a4cc /libwc/charset.c
parentMerge branch 'bug/printf' (diff)
downloadw3m-cbec7032ee36346649fc5ebecc4b1c01f01178f1.tar.gz
w3m-cbec7032ee36346649fc5ebecc4b1c01f01178f1.zip
Add overflow detection
Origin: http://marc.info/?l=openbsd-ports&m=142090828929750&w=2 * main.c: Call exit(1) when out of memory to avoid dereferencing null pointers when gc's malloc fails. * alloc.h: Replacements for w3m's allocation macros which add overflow detection and concentrate the macros in one file. * indep.h, libwc/charset.c, libwc/status.c, matrix.c: Use the overflow-detecting allocation macros from alloc.h.
Diffstat (limited to '')
-rw-r--r--libwc/charset.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libwc/charset.c b/libwc/charset.c
index 3f0b74d..ea79b1c 100644
--- a/libwc/charset.c
+++ b/libwc/charset.c
@@ -1,8 +1,7 @@
#include <stdlib.h>
#include <ctype.h>
-#include <gc.h>
-#define New_N(type,n) ((type*)GC_MALLOC((n)*sizeof(type)))
+#include "../alloc.h"
#include "wc.h"