From: Nick Clifton Date: Fri, 12 Oct 2007 16:25:21 +0000 (+0000) Subject: PR 5160 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4b93929bf941cecadd453ed23b378ee6ccfeb36e;p=binutils-gdb.git PR 5160 * elflink.c (eval_symbol): Remove bufsz variable and use sizeof(symbuf) where necessary. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2ed0e4aa037..fba19d22f8b 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2007-10-12 Nick Clifton + + PR 5160 + * elflink.c (eval_symbol): Remove bufsz variable and use + sizeof(symbuf) where necessary. + 2007-10-12 M R Swami Reddy * elf32-cr16.c (elf32_cr16_relax_section): Fix condition check typo. diff --git a/bfd/elflink.c b/bfd/elflink.c index bdcccbb1939..49d75b03e0e 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -7389,12 +7389,11 @@ eval_symbol (bfd_vma *result, size_t locsymcount, int signed_p) { - int len; - int symlen; + size_t len; + size_t symlen; bfd_vma a; bfd_vma b; - const int bufsz = 4096; - char symbuf[bufsz]; + char symbuf[4096]; const char *sym = *symp; const char *symend; bfd_boolean symbol_is_section = FALSE; @@ -7402,7 +7401,7 @@ eval_symbol (bfd_vma *result, len = strlen (sym); symend = sym + len; - if (len < 1 || len > bufsz) + if (len < 1 || len > sizeof (symbuf)) { bfd_set_error (bfd_error_invalid_operation); return FALSE; @@ -7427,7 +7426,7 @@ eval_symbol (bfd_vma *result, symlen = strtol (sym, (char **) symp, 10); sym = *symp + 1; /* Skip the trailing ':'. */ - if (symend < sym || symlen + 1 > bufsz) + if (symend < sym || symlen + 1 > sizeof (symbuf)) { bfd_set_error (bfd_error_invalid_operation); return FALSE;