Commit 79bf429
dgram: fix send with out of bounds offset + length
fix Socket.prototype.send sending garbage when the message is a string,
or Buffer and offset+length is out of bounds.
Fixes: #40491
PR-URL: #40568
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>1 parent 825a683 commit 79bf429Copy full SHA for 79bf429
File tree
Expand file treeCollapse file tree
2 files changed
+49
-0
lines changedOpen diff view settings
Filter options
- lib
- test/parallel
Expand file treeCollapse file tree
2 files changed
+49
-0
lines changedOpen diff view settings
Collapse file
+8Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
40 | 40 | |
41 | 41 | |
42 | 42 | |
| 43 | + |
43 | 44 | |
44 | 45 | |
45 | 46 | |
| ||
487 | 488 | |
488 | 489 | |
489 | 490 | |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
490 | 498 | |
491 | 499 | |
492 | 500 | |
|
Collapse file
test/parallel/test-dgram-send-bad-arguments.js
Copy file name to clipboardExpand all lines: test/parallel/test-dgram-send-bad-arguments.js+41Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
77 | 77 | |
78 | 78 | |
79 | 79 | |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
80 | 121 | |
81 | 122 | |
82 | 123 | |
|
0 commit comments