summaryrefslogtreecommitdiffstats
path: root/libelf/gelf_getlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/gelf_getlib.c')
-rw-r--r--libelf/gelf_getlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libelf/gelf_getlib.c b/libelf/gelf_getlib.c
index 9a8a1749..880817e6 100644
--- a/libelf/gelf_getlib.c
+++ b/libelf/gelf_getlib.c
@@ -1,5 +1,5 @@
/* Get library from table at the given index.
- Copyright (C) 2004 Red Hat, Inc.
+ Copyright (C) 2004, 2005, 2009, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 2004.
@@ -65,7 +65,7 @@ gelf_getlib (data, ndx, dst)
/* The data is already in the correct form. Just make sure the
index is OK. */
GElf_Lib *result = NULL;
- if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
+ if (INVALID_NDX (ndx, GElf_Lib, data))
__libelf_seterrno (ELF_E_INVALID_INDEX);
else
{