Просмотр исходного кода

Close smux session in acceptStreams of server.

This was a memory leak.

Compare to the `sess.Close()` in the client:
https://repo.or.cz/dnstt.git/blob/2fe067548848f7dd1acb527a20699d7d2358d150:/dnstt-client/main.go#l174

This is issue UCB-02-002 from the 2021 security audit of Turbo Tunnel by
Cure53.
David Fifield 5 лет назад
Родитель
Сommit
b6b803986c
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      dnstt-server/main.go

+ 1 - 0
dnstt-server/main.go

@@ -237,6 +237,7 @@ func acceptStreams(conn *kcp.UDPSession, privkey, pubkey []byte, upstream *net.T
 	if err != nil {
 		return err
 	}
+	defer sess.Close()
 
 	for {
 		stream, err := sess.AcceptStream()