diff options
| author | Matt Hunter <m@lfurio.us> | 2025-07-26 21:02:43 -0400 |
|---|---|---|
| committer | Matt Hunter <m@lfurio.us> | 2025-07-26 21:11:34 -0400 |
| commit | 6921d7a374f6981b45cd41f773820cd711f417e5 (patch) | |
| tree | 9ab97b9302cb308d7f253216f84a80d0abecf218 | |
| parent | 27bb9ccc06b715ea8f76c269e8bc2fab03110155 (diff) | |
| download | misplays-6921d7a374f6981b45cd41f773820cd711f417e5.tar.gz misplays-6921d7a374f6981b45cd41f773820cd711f417e5.zip | |
Fix possible segfault in dbg_detach
If dbg_attach fails, it calls this function to clean up before the
process in added to the main process list, so list_remove() is invalid.
Signed-off-by: Matt Hunter <m@lfurio.us>
| -rw-r--r-- | debugger.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -532,7 +532,9 @@ void dbg_detach(struct process *proc) { } free_breakpoints(proc); - list_remove(proc); + if (proc->next) { /* workaround: its invalid to list_remove() if dbg_attach fails */ + list_remove(proc); + } free(proc); } |
