diff options
author | Martin Liska <mliska@suse.cz> | 2019-01-24 09:27:39 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-01-24 08:27:39 +0000 |
commit | 12502bf2e905cba16edf28941a37e6de432ea108 (patch) | |
tree | 3bb6d2911140400e28773f6ab238f857c25988d5 /gcc/gcov-io.c | |
parent | 07fd2247eed45cd69c7b2294fe528c9bbe7a838e (diff) | |
download | gcc-12502bf2e905cba16edf28941a37e6de432ea108.zip gcc-12502bf2e905cba16edf28941a37e6de432ea108.tar.gz gcc-12502bf2e905cba16edf28941a37e6de432ea108.tar.bz2 |
Fix broken filename for .gcda files starting with '..' (PR gcov-profile/88994).
2019-01-24 Martin Liska <mliska@suse.cz>
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
Diffstat (limited to 'gcc/gcov-io.c')
-rw-r--r-- | gcc/gcov-io.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 |