Commit c45738b
Fix use-after-free on duplicate async DNS response
When a duplicate async DNS response packet is received, the code would
jump to the `fail_out` label, which destroys the query object `q`.
This is incorrect if the query is still waiting for other responses
(eg, AAAA after getting a duplicate A response). The destruction of `q`
leads to a use-after-free when the next response for the same query
arrives, causing memory corruption and sporadic crashes.
The fix is to simply return when a duplicate packet is detected,
ignoring it, without destroying the query object.1 parent 56a1d4b commit c45738b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| |||
0 commit comments