Commit 6fb36c3
committed
Fix NULL dereference in accept_callback when process terminates
If the owning process terminates between the accept() call and
globalcontext_get_process_lock(), ctx will be NULL. The code
immediately dereferences ctx->platform_data without checking,
causing a segfault. Add a NULL check consistent with other
callbacks (e.g. recv_callback), closing the accepted fd if
needed and freeing the listener before returning.
Signed-off-by: Peter M <petermm@gmail.com>1 parent 8897a34 commit 6fb36c3
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1046 | 1046 | | |
1047 | 1047 | | |
1048 | 1048 | | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1049 | 1056 | | |
1050 | 1057 | | |
1051 | 1058 | | |
| |||
0 commit comments