This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch RFC] Fix PR binutils/2584
On Thu, Apr 27, 2006 at 12:14:23PM +0900, Kaz Kojima wrote:
> -static bfd_vma
> -getvalue (char **srcp)
> +static bfd_boolean
> +getvalue (char **srcp, bfd_vma *valuep)
> {
> char *src = *srcp;
> bfd_vma value = 0;
> - unsigned int len = hex_value(*src++);
> + unsigned int len;
> +
> + if (!ISHEX (*src))
> + return FALSE;
>
> + len = hex_value (*src++);
> if (len == 0)
> len = 16;
> while (len--)
> value = value << 4 | hex_value(*src++);
You missed checking for a valid hex number here. Otherwise the patch
looks OK.
--
Alan Modra
IBM OzLabs - Linux Technology Centre