diff options
| author | Mark Wielaard <[email protected]> | 2020-11-01 23:45:32 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2020-11-01 23:45:32 +0100 |
| commit | 8dd97a0a871672b3f7a58e1fb50b6f7195d8f32d (patch) | |
| tree | 3a86d4fb1d7abf6966ff94a1e25f13f7e1809c48 /libdwfl/linux-pid-attach.c | |
| parent | 50a6eeef7d87623faa65126dc3d16c2a8e613aea (diff) | |
| parent | b503c358dde835d8a1ae3ebd4968755ff396f814 (diff) | |
Merge tag 'elfutils-0.182' into mjw/RH-DTSdts-0.182
elfutils 0.182 release
Diffstat (limited to 'libdwfl/linux-pid-attach.c')
| -rw-r--r-- | libdwfl/linux-pid-attach.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c index f19e9b49..3a6af997 100644 --- a/libdwfl/linux-pid-attach.c +++ b/libdwfl/linux-pid-attach.c @@ -422,7 +422,11 @@ dwfl_linux_proc_attach (Dwfl *dwfl, pid_t pid, bool assume_ptrace_stopped) char name[64]; int i = snprintf (name, sizeof (name), "/proc/%ld/task", (long) pid); - assert (i > 0 && i < (ssize_t) sizeof (name) - 1); + if (i <= 0 || i >= (ssize_t) sizeof (name) - 1) + { + errno = -ENOMEM; + goto fail; + } DIR *dir = opendir (name); if (dir == NULL) { |
