OSDN Git Service

[FileCheck] - Fix possible buffer out of bounds access when parsing --check-prefix.
authorGeorge Rimar <grimar@accesssoftek.com>
Tue, 16 Jan 2018 08:09:24 +0000 (08:09 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Tue, 16 Jan 2018 08:09:24 +0000 (08:09 +0000)
commit3206f3b6c73af99faa35afdd119aaee95d4693ef
treeeaf3806aa8f46ff7efc5704349d109fff49848b2
parent7283ac31b439c7b43c8504fa1eb81bf631e956af
[FileCheck] - Fix possible buffer out of bounds access when parsing --check-prefix.

FileCheck tool crashes when trying to parse --check-prefix argument if there is no any
data after it.

For example test like following would crash if there are no symbols and no EOL mark after `boom`:

# REQUIRES: x86
# RUN: <skipped few lines>
# RUN: llvm-readobj -t %t | FileCheck %s --check-prefix=boom

Patch fixes the issue.

Differential revision: https://reviews.llvm.org/D42057

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322536 91177308-0d34-0410-b5e6-96231b3b80d8
test/FileCheck/check-empty2.txt [new file with mode: 0644]
utils/FileCheck/FileCheck.cpp