summaryrefslogtreecommitdiffstats
path: root/libelf/gelf_getsym.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/gelf_getsym.c')
-rw-r--r--libelf/gelf_getsym.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libelf/gelf_getsym.c b/libelf/gelf_getsym.c
index 183872e2..40347e8c 100644
--- a/libelf/gelf_getsym.c
+++ b/libelf/gelf_getsym.c
@@ -1,5 +1,5 @@
/* Get symbol information from symbol table at the given index.
- Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
+ Copyright (C) 1999-2009 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 1999.
@@ -69,7 +69,7 @@ gelf_getsym (data, ndx, dst)
table entries has to be adopted. The user better has provided
a buffer where we can store the information. While copying the
data we are converting the format. */
- if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
+ if (INVALID_NDX (ndx, Elf32_Sym, data))
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;
@@ -98,7 +98,7 @@ gelf_getsym (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
- if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
+ if (INVALID_NDX (ndx, GElf_Sym, data))
{
__libelf_seterrno (ELF_E_INVALID_INDEX);
goto out;