From 14bb8302c42576112472fdf7491dbb369c3e6db5 Mon Sep 17 00:00:00 2001 From: mingodad Date: Thu, 27 Mar 2014 22:15:45 +0000 Subject: [PATCH] Fix a incorrect size for malloc. --- libtcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index 601999e..9f486f3 100644 --- a/libtcc.c +++ b/libtcc.c @@ -330,7 +330,7 @@ ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh { Section *sec; - sec = tcc_mallocz(sizeof(Section) + strlen(name)); + sec = tcc_mallocz(sizeof(Section) + strlen(name)+1); strcpy(sec->name, name); sec->sh_type = sh_type; sec->sh_flags = sh_flags;