summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-12-10 04:18:03 +0000
committerkmacy <kmacy@FreeBSD.org>2006-12-10 04:18:03 +0000
commit6a6429aa4ca2dc8188ab000180a45809d622c0ba (patch)
tree276393251fe258af06797bbc40dd84121afd8c40 /sys
parentd60154cb6519d2023a2928a158f73cd54d7d5200 (diff)
downloadFreeBSD-src-6a6429aa4ca2dc8188ab000180a45809d622c0ba.zip
FreeBSD-src-6a6429aa4ca2dc8188ab000180a45809d622c0ba.tar.gz
Do explicit bounds checking as a function of the actual size of the
reloc_target_bitmask array as opposed to the (known) index of the last value. This change fixes CID 691.
Diffstat (limited to 'sys')
-rw-r--r--sys/sparc64/sparc64/elf_machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/elf_machdep.c b/sys/sparc64/sparc64/elf_machdep.c
index 1b9bbc2..ede021a 100644
--- a/sys/sparc64/sparc64/elf_machdep.c
+++ b/sys/sparc64/sparc64/elf_machdep.c
@@ -310,7 +310,7 @@ elf_reloc(linker_file_t lf, Elf_Addr relocbase, const void *data, int type,
return (0);
if (rtype == R_SPARC_JMP_SLOT || rtype == R_SPARC_COPY ||
- rtype > R_SPARC_UA16)
+ rtype >= (sizeof(reloc_target_bitmask)/sizeof(long)))
return (-1);
if (RELOC_UNALIGNED(rtype))
OpenPOWER on IntegriCloud