Skip to content

Commit

Permalink
Do not throw an exception if the Corefile cannot be deleted after copy
Browse files Browse the repository at this point in the history
  • Loading branch information
zachriggle committed Jan 25, 2018
1 parent c7c5019 commit 63dfed7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pwnlib/elf/corefile.py
Expand Up @@ -1162,7 +1162,10 @@ def __init__(self, proc):
new_path = 'core.%i' % core_pid
if core_pid > 0 and new_path != self.core_path:
write(new_path, self.read(self.core_path))
self.unlink(self.core_path)
try:
self.unlink(self.core_path)
except (IOError, OSError):
log.warn("Could not delete %r" % self.core_path)
self.core_path = new_path

# Check the PID
Expand Down

0 comments on commit 63dfed7

Please sign in to comment.