Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP socket sends garbage when excess length is specified #40491

Closed
farteryhr opened this issue Oct 17, 2021 · 1 comment
Closed

UDP socket sends garbage when excess length is specified #40491

farteryhr opened this issue Oct 17, 2021 · 1 comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP.

Comments

@farteryhr
Copy link

Version

v14.18.1

Platform

Microsoft Windows NT 10.0.19042.0 x64

Subsystem

No response

What steps will reproduce the bug?

https://www.cnblogs.com/ay-a/p/9822268.html

udp_client.send(SendBuff, 0, SendLen, 5678, '172.30.20.10');

Basically produces with the simplest setup, just add some magic to sendLen in client code.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

nice question. error? zero padding? truncation?

What do you see instead?

horrific screenshot.png

Additional information

wondering should this go in security?

@Mesteery Mesteery added the dgram Issues and PRs related to the dgram subsystem / UDP. label Oct 17, 2021
@Linkgoron
Copy link
Member

I think I've found the issue, working on the fix.

Linkgoron added a commit to Linkgoron/node that referenced this issue Oct 22, 2021
fix Socket.prototype.send sending garbage when the message is a string,
and offset+length is out of bounds.

Fixes: nodejs#40491
Linkgoron added a commit to Linkgoron/node that referenced this issue Oct 22, 2021
fix Socket.prototype.send sending garbage when the message is a string,
or Buffer and offset+length is out of bounds.

Fixes: nodejs#40491
Linkgoron added a commit to Linkgoron/node that referenced this issue Oct 22, 2021
fix Socket.prototype.send sending garbage when the message is a string,
or Buffer and offset+length is out of bounds.

Fixes: nodejs#40491
targos pushed a commit that referenced this issue Nov 6, 2021
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
BethGriggs pushed a commit that referenced this issue Nov 25, 2021
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants