Ver código fonte

Fix uTP sniffer

世界 8 meses atrás
pai
commit
24af0766ac
2 arquivos alterados com 8 adições e 1 exclusões
  1. 3 1
      common/sniff/bittorrent.go
  2. 5 0
      common/sniff/bittorrent_test.go

+ 3 - 1
common/sniff/bittorrent.go

@@ -68,7 +68,9 @@ func UTP(_ context.Context, metadata *adapter.InboundContext, packet []byte) err
 		if err != nil {
 			return err
 		}
-
+		if extension > 0x04 {
+			return os.ErrInvalid
+		}
 		var length byte
 		err = binary.Read(reader, binary.BigEndian, &length)
 		if err != nil {

Diferenças do arquivo suprimidas por serem muito extensas
+ 5 - 0
common/sniff/bittorrent_test.go


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff