summaryrefslogtreecommitdiffstats
path: root/libelf/elf_getarsym.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/elf_getarsym.c')
-rw-r--r--libelf/elf_getarsym.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
index d0bb28a9..7325190a 100644
--- a/libelf/elf_getarsym.c
+++ b/libelf/elf_getarsym.c
@@ -1,5 +1,5 @@
/* Return symbol table of archive.
- Copyright (C) 1998-2000, 2002, 2005, 2012 Red Hat, Inc.
+ Copyright (C) 1998-2000, 2002, 2005, 2009, 2012, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 1998.
@@ -183,6 +183,9 @@ elf_getarsym (elf, ptr)
size_t index_size = atol (tmpbuf);
if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
+#if SIZE_MAX <= 4294967295U
+ || n >= SIZE_MAX / sizeof (Elf_Arsym)
+#endif
|| n * w > index_size)
{
/* This index table cannot be right since it does not fit into