llvm.org GIT mirror llvm / 696e06e
YAMLParser: Fix invalid reads when encountering incorrectly quoted scalar. Fixes PR12632. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164701 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 6 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
902902 void Scanner::skip(uint32_t Distance) {
903903 Current += Distance;
904904 Column += Distance;
905 assert(Current <= End && "Skipped past the end");
905906 }
906907
907908 bool Scanner::isBlankOrBreak(StringRef::iterator Position) {
12381239 }
12391240 }
12401241 }
1242
1243 if (Current == End) {
1244 setError("Expected quote at end of scalar", Current);
1245 return false;
1246 }
1247
12411248 skip(1); // Skip ending quote.
12421249 Token T;
12431250 T.Kind = Token::TK_Scalar;