mirror of
https://github.com/NixOS/nix.git
synced 2025-11-27 20:51:00 +01:00
libexpr: fix stack overflow in toJSON on deeply nested structures
Similar to the deepSeq fix, toJSON on deeply nested structures caused an uncontrolled OS-level stack overflow. Fix by adding call depth tracking to printValueAsJSON.
This commit is contained in:
parent
a812b6c6e6
commit
c7e1c612eb
5 changed files with 109 additions and 0 deletions
|
|
@ -16,6 +16,8 @@ json printValueAsJSON(
|
|||
{
|
||||
checkInterrupt();
|
||||
|
||||
auto _level = state.addCallDepth(pos);
|
||||
|
||||
if (strict)
|
||||
state.forceValue(v, pos);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue