Skip to content

Fix incorrectly encoded empty SOCKS5 address#8292

Merged
normanmaurer merged 1 commit intonetty:4.1from
Vampire:fix-socks5-address-encoder
Sep 18, 2018
Merged

Fix incorrectly encoded empty SOCKS5 address#8292
normanmaurer merged 1 commit intonetty:4.1from
Vampire:fix-socks5-address-encoder

Conversation

@Vampire
Copy link
Copy Markdown
Contributor

@Vampire Vampire commented Sep 15, 2018

Motivation:

If you encode a SOCKS5 message like new DefaultSocks5CommandResponse(FAILURE, DOMAIN, "", 0)
you correctly get a result of 05010003000000.
But if the bndAddr is null, for example like new DefaultSocks5CommandResponse(FAILURE, DOMAIN)
the encoded result is 0501000301000000 which means the domain name has a length of one and consists of a 0-byte.

Modification:

With this commit it is also correctly encoded as a string of 0 length.

@Vampire Vampire force-pushed the fix-socks5-address-encoder branch from a19edca to 53abcce Compare September 15, 2018 23:40
If you encode a SOCKS5 message like 'new DefaultSocks5CommandResponse(FAILURE, DOMAIN, "", 0)'
you correctly get a result of '05010003000000'.
But if the 'bndAddr' is 'null', for example like 'new DefaultSocks5CommandResponse(FAILURE, DOMAIN)'
the encoded result is '0501000301000000' which means the domain name has a length of one and consists of a 0-byte.
With this commit it is also correctly encoded as a string of 0 length.
@Vampire Vampire force-pushed the fix-socks5-address-encoder branch from 53abcce to d5a9dd2 Compare September 16, 2018 00:17
@normanmaurer
Copy link
Copy Markdown
Member

@Vampire can you please sign our ICLA and let me know once done ?

https://netty.io/s/icla

@Vampire
Copy link
Copy Markdown
Contributor Author

Vampire commented Sep 17, 2018

Done

@normanmaurer normanmaurer self-requested a review September 18, 2018 21:19
@normanmaurer normanmaurer self-assigned this Sep 18, 2018
@normanmaurer normanmaurer added this to the 4.1.30.Final milestone Sep 18, 2018
@normanmaurer normanmaurer merged commit 1b6e47a into netty:4.1 Sep 18, 2018
@normanmaurer
Copy link
Copy Markdown
Member

@Vampire merged... thanks!

@Vampire Vampire deleted the fix-socks5-address-encoder branch September 19, 2018 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants