mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Fix stack overflow (#807)
Fix stack overflow in HandleNode by explicitly limiting the depth of recursion.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
|
||||
namespace YAML {
|
||||
class CollectionStack;
|
||||
template <int> class DepthGuard; // depthguard.h
|
||||
class EventHandler;
|
||||
class Node;
|
||||
class Scanner;
|
||||
@@ -55,6 +56,7 @@ class SingleDocParser {
|
||||
anchor_t LookupAnchor(const Mark& mark, const std::string& name) const;
|
||||
|
||||
private:
|
||||
int depth = 0;
|
||||
Scanner& m_scanner;
|
||||
const Directives& m_directives;
|
||||
std::unique_ptr<CollectionStack> m_pCollectionStack;
|
||||
|
Reference in New Issue
Block a user