[profile] Fix buffer overrun when parsing %c in filename string
authorVedant Kumar <vsk@apple.com>
Tue, 23 Feb 2021 00:36:37 +0000 (16:36 -0800)
committerVedant Kumar <vsk@apple.com>
Wed, 24 Feb 2021 22:49:45 +0000 (14:49 -0800)
commita7d4826101aba8594bf5308c6a3e40c44608bca5
treead4c3abd89be24829652ead249d18391413b0a3f
parent680f836c2fa72166badd594a52b3f41b2ad074d2
[profile] Fix buffer overrun when parsing %c in filename string

Fix a buffer overrun that can occur when parsing '%c' at the end of a
filename pattern string.

rdar://74571261

Reviewed By: kastiglione

Differential Revision: https://reviews.llvm.org/D97239
compiler-rt/lib/profile/InstrProfilingFile.c
compiler-rt/test/profile/ContinuousSyncMode/get-filename.c [new file with mode: 0644]