[Crash-utility] [PATCH 1/2] mips: fix missing note check
Dave Anderson
anderson at redhat.com
Mon Dec 5 17:15:00 UTC 2016
----- Original Message -----
> From: Rabin Vincent <rabinv at axis.com>
>
> Add a missing continue after we check if note is NULL. Otherwise we
> proceed and dereference the NULL pointer and segfault after printing the
> "cannot find NT_PRSTATUS note for cpu" warning.
> ---
> mips.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mips.c b/mips.c
> index 5f74b7c..30e6255 100644
> --- a/mips.c
> +++ b/mips.c
> @@ -939,9 +939,11 @@ static int mips_get_elf_notes(void)
> else if (KDUMP_DUMPFILE())
> note = netdump_get_prstatus_percpu(i);
>
> - if (!note)
> + if (!note) {
> error(WARNING,
> "cannot find NT_PRSTATUS note for cpu: %d\n", i);
> + continue;
> + }
>
> len = sizeof(Elf32_Nhdr);
> len = roundup(len + note->n_namesz, 4);
> --
> 2.1.4
>
> --
Queued for crash-7.1.8:
https://github.com/crash-utility/crash/commit/c7a6b862ca65f216874e50b0d469dba2c910323a
Thanks,
Dave
More information about the Crash-utility
mailing list