Commit bf4faf3
assert,util: harden comparison
The former algorithm used checks which were unsafe. Most of these
have been replaced with alternatives that can not be manipulated or
fooled that easily.
PR-URL: #24831
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>1 parent 25dae6c commit bf4faf3Copy full SHA for bf4faf3
File tree
Expand file treeCollapse file tree
2 files changed
+102
-13
lines changedOpen diff view settings
Filter options
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
2 files changed
+102
-13
lines changedOpen diff view settings
Collapse file
lib/internal/util/comparisons.js
Copy file name to clipboardExpand all lines: lib/internal/util/comparisons.js+38-13Lines changed: 38 additions & 13 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
7 | 7 | |
8 | 8 | |
9 | 9 | |
10 | | - |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
11 | 18 | |
12 | 19 | |
13 | 20 | |
| ||
33 | 40 | |
34 | 41 | |
35 | 42 | |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
36 | 50 | |
37 | 51 | |
38 | 52 | |
| ||
82 | 96 | |
83 | 97 | |
84 | 98 | |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
85 | 117 | |
86 | 118 | |
87 | 119 | |
| ||
117 | 149 | |
118 | 150 | |
119 | 151 | |
120 | | - |
| 152 | + |
121 | 153 | |
122 | 154 | |
123 | 155 | |
| ||
133 | 165 | |
134 | 166 | |
135 | 167 | |
136 | | - |
137 | | - |
| 168 | + |
138 | 169 | |
139 | 170 | |
140 | 171 | |
141 | 172 | |
142 | 173 | |
143 | 174 | |
144 | | - |
| 175 | + |
145 | 176 | |
146 | 177 | |
147 | 178 | |
| ||
175 | 206 | |
176 | 207 | |
177 | 208 | |
178 | | - |
179 | | - |
180 | | - |
181 | | - |
182 | | - |
183 | | - |
184 | | - |
185 | | - |
| 209 | + |
| 210 | + |
186 | 211 | |
187 | 212 | |
188 | 213 | |
|
Collapse file
test/parallel/test-assert-deep.js
Copy file name to clipboardExpand all lines: test/parallel/test-assert-deep.js+64Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
985 | 985 | |
986 | 986 | |
987 | 987 | |
| 988 | + |
| 989 | + |
| 990 | + |
| 991 | + |
| 992 | + |
| 993 | + |
| 994 | + |
| 995 | + |
| 996 | + |
| 997 | + |
| 998 | + |
| 999 | + |
| 1000 | + |
| 1001 | + |
| 1002 | + |
| 1003 | + |
| 1004 | + |
| 1005 | + |
| 1006 | + |
| 1007 | + |
| 1008 | + |
| 1009 | + |
| 1010 | + |
| 1011 | + |
| 1012 | + |
| 1013 | + |
| 1014 | + |
| 1015 | + |
| 1016 | + |
| 1017 | + |
| 1018 | + |
| 1019 | + |
| 1020 | + |
| 1021 | + |
| 1022 | + |
| 1023 | + |
| 1024 | + |
| 1025 | + |
| 1026 | + |
| 1027 | + |
| 1028 | + |
| 1029 | + |
| 1030 | + |
| 1031 | + |
| 1032 | + |
| 1033 | + |
| 1034 | + |
| 1035 | + |
| 1036 | + |
| 1037 | + |
| 1038 | + |
| 1039 | + |
| 1040 | + |
| 1041 | + |
| 1042 | + |
| 1043 | + |
| 1044 | + |
| 1045 | + |
| 1046 | + |
| 1047 | + |
| 1048 | + |
| 1049 | + |
| 1050 | + |
| 1051 | + |
0 commit comments