diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -1662,6 +1662,10 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error {
 					me.mu.Lock()
 					me.addPeers(t, func() (ret []Peer) {
 						for i, cp := range pexMsg.Added {
+							if cp.Port == 0 {
+								log.Printf("peer gave zero port peer over PEX\n\t%s", c)
+								continue
+							}
 							p := Peer{
 								IP:     make([]byte, 4),
 								Port:   int(cp.Port),
Log who's giving us zero ports over PEX

In the long run this will help determine why this happens.