Commit 200429e
buffer: ignore negative allocation lengths
Treat negative length arguments to `Buffer()`/`allocUnsafe()`
as if they were zero so the allocation does not affect the
pool’s offset.
Fixes: #7047
Refs: #7051
Refs: #7221
Refs: #7475
PR-URL: #7562
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>1 parent e544b1c commit 200429eCopy full SHA for 200429e
File tree
Expand file treeCollapse file tree
1 file changed
+2
-2
lines changedOpen diff view settings
Filter options
- lib
Expand file treeCollapse file tree
1 file changed
+2
-2
lines changedOpen diff view settings
Collapse file
+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | | - |
83 | | - |
| 82 | + |
| 83 | + |
84 | 84 | |
85 | 85 | |
86 | 86 | |
|
0 commit comments