[committed] RISC-V: PR28610, Fix ASAN heap-buffer-overflow error in riscv_update_subset.

Andreas Schwab schwab@linux-m68k.org
Mon Nov 22 09:37:33 GMT 2021


On Nov 22 2021, Nelson Chu wrote:

> diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
> index b8da40c..73a99b5 100644
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -2211,6 +2211,9 @@ riscv_update_subset (riscv_parse_subset_t *rps,
>  {
>    const char *p = str;
>  
> +  if (p == NULL)
> +    return false;

How can that ever happen?

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


More information about the Binutils mailing list