Commit ec5b06e
util: fix infinite recursion during inspection
A specially crafted object with circular structures behind getters
could cause a infinite recursion. This is now fixed by detecting the
objects as already visited.
Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>
PR-URL: #37079
Fixes: #37054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>1 parent 67e9e71 commit ec5b06eCopy full SHA for ec5b06e
File tree
Expand file treeCollapse file tree
2 files changed
+55
-15
lines changedOpen diff view settings
Filter options
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
2 files changed
+55
-15
lines changedOpen diff view settings
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
5 | 5 | |
6 | 6 | |
7 | 7 | |
| 8 | + |
8 | 9 | |
9 | 10 | |
10 | 11 | |
| ||
620 | 621 | |
621 | 622 | |
622 | 623 | |
| 624 | + |
623 | 625 | |
624 | 626 | |
625 | 627 | |
| ||
640 | 642 | |
641 | 643 | |
642 | 644 | |
| 645 | + |
643 | 646 | |
644 | 647 | |
645 | 648 | |
|
Collapse file
test/parallel/test-util-inspect-getters-accessing-this.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect-getters-accessing-this.js+52-15Lines changed: 52 additions & 15 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
7 | 7 | |
8 | 8 | |
9 | 9 | |
10 | | - |
| 10 | + |
11 | 11 | |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
16 | 17 | |
17 | | - |
18 | | - |
| 18 | + |
| 19 | + |
| 20 | + |
19 | 21 | |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
20 | 32 | |
21 | 33 | |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
26 | 59 | |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
0 commit comments