From da0f33370a35fcadf743e2f56cdf7f71bd2e24db Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 5 Oct 2012 12:05:26 +0200 Subject: [PATCH] widl: Alloc big enough buffer in dup_basename to handle registration suffix. --- tools/widl/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/widl/utils.c b/tools/widl/utils.c index dc77ae87438..90668873aac 100644 --- a/tools/widl/utils.c +++ b/tools/widl/utils.c @@ -159,8 +159,8 @@ char *dup_basename(const char *name, const char *ext) namelen = strlen(name); - /* +4 for later extension and +1 for '\0' */ - base = xmalloc(namelen +4 +1); + /* +6 for later extension (strlen("_r.rgs")) and +1 for '\0' */ + base = xmalloc(namelen +6 +1); strcpy(base, name); if(!strcasecmp(name + namelen-extlen, ext)) {