Commit de018ed
committed
Fix DOS attack from malicous pongs
A double channel close panic was possible if a peer sent back multiple
pongs for every ping.
If the second pong arrived before the ping goroutine deleted its channel
from the map, the channel would be closed twice and so a panic would
ensue.
This fixes that by having the read goroutine send on the ping
goroutine's channel rather than closing it.
Reported via email by Tibor Kálmán <kalmantibor2@gmail.com>
Please update to the new release ASAP!1 parent e4c3b0f commit de018ed
2 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
275 | 278 | | |
276 | 279 | | |
277 | 280 | | |
| |||
0 commit comments