Truncate DCC port to unsigned short before checking for a privileged port

Checking before truncation means you can sneak a privileged port past the check.

This change also collects the various broken-out parts of a CTCP DCC offer into a struct so that
it's easier to pass them all around together.
This commit is contained in:
Kevin Easton
2016-11-02 23:58:11 +11:00
parent 23d466c4a1
commit 6cac0e6bb1
4 changed files with 116 additions and 122 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2]
* Fix bug in DCC privileged port detection logic. (caf)
* Don't show DCC "Handshake failed" message twice, improve the message itself
and use the same one for privileged port / zero address. (caf)