From 12502bf2e905cba16edf28941a37e6de432ea108 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 24 Jan 2019 09:27:39 +0100 Subject: Fix broken filename for .gcda files starting with '..' (PR gcov-profile/88994). 2019-01-24 Martin Liska PR gcov-profile/88994 * gcov-io.c (mangle_path): Do not allocate a bigger buffer, result will be always smaller or equal to the original. * gcov.c (mangle_name): Fix else branch where we should also copy to PTR and shift the pointer. From-SVN: r268233 --- gcc/gcov-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/gcov-io.c') diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c index e3b1c5c..1f8ac37 100644 --- a/gcc/gcov-io.c +++ b/gcc/gcov-io.c @@ -547,7 +547,7 @@ mangle_path (char const *base) /* Convert '/' to '#', convert '..' to '^', convert ':' to '~' on DOS based file system. */ const char *probe; - char *buffer = (char *)xmalloc (strlen (base) + 10); + char *buffer = (char *)xmalloc (strlen (base) + 1); char *ptr = buffer; #if HAVE_DOS_BASED_FILE_SYSTEM -- cgit v1.1