mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 12:21:17 +00:00
fix(src): avoid possible infinite loop in LoadAll().
Leave at first empty root. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:

committed by
Jesse Beder

parent
da82fd982c
commit
bc67157109
@@ -53,7 +53,7 @@ std::vector<Node> LoadAll(std::istream& input) {
|
||||
Parser parser(input);
|
||||
while (true) {
|
||||
NodeBuilder builder;
|
||||
if (!parser.HandleNextDocument(builder)) {
|
||||
if (!parser.HandleNextDocument(builder) || builder.Root().IsNull()) {
|
||||
break;
|
||||
}
|
||||
docs.push_back(builder.Root());
|
||||
|
Reference in New Issue
Block a user