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:
10
src/depthguard.cpp
Normal file
10
src/depthguard.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "yaml-cpp/depthguard.h"
|
||||
|
||||
namespace YAML {
|
||||
|
||||
DeepRecursion::DeepRecursion(int depth, const Mark& mark_, const std::string& msg_)
|
||||
: ParserException(mark_, msg_),
|
||||
m_depth(depth) {
|
||||
}
|
||||
|
||||
} // namespace YAML
|
Reference in New Issue
Block a user