]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Fix transport message length check
authorChris Branch <cbranch@cloudflare.com>
Thu, 20 Sep 2018 12:28:53 +0000 (13:28 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 25 Sep 2018 03:18:11 +0000 (05:18 +0200)
wireguard-go has a bad length check in its transport message handling.
Although it cannot be exploited because of another length check earlier in the
function, this should be fixed regardless.

receive.go

index 01151cadd2376b2efe2c76e181467869d87dfda5..abe4e5748400c85b4c1c0ddff60d69cbe14d1359 100644 (file)
@@ -147,7 +147,7 @@ func (device *Device) RoutineReceiveIncoming(IP int, bind Bind) {
 
                        // check size
 
-                       if len(packet) < MessageTransportType {
+                       if len(packet) < MessageTransportSize {
                                continue
                        }