Fix null dereference in yaml::Document::skip
authorThomas Finch <tfinch@apple.com>
Tue, 12 Nov 2019 04:48:28 +0000 (20:48 -0800)
committerDon Hinton <hintonda@gmail.com>
Tue, 12 Nov 2019 04:48:28 +0000 (20:48 -0800)
commitac385ca63fe8bc283d7f5be213319cc3b930b4cc
tree807885a84d47f74548b4287a6f682f96411c8312
parent6ebec32b1265af646b039150b2df790c610a20fe
Fix null dereference in yaml::Document::skip

Summary: The attached test case replicates a null dereference crash in
`yaml::Document::skip()`. This was fixed by adding a check and early
return in the method.

Reviewers: Bigcheese, hintonda, beanz

Reviewed By: hintonda

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69974
llvm/lib/Support/YAMLParser.cpp
llvm/unittests/Support/YAMLParserTest.cpp