summaryrefslogtreecommitdiffstats
path: root/lib/libproc
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2013-10-29 03:52:05 +0000
committermarkj <markj@FreeBSD.org>2013-10-29 03:52:05 +0000
commit756d4686b39ff2a93f1aab3ac223d5257ce6d7cc (patch)
treed01ab7e813c719636266b3a63ada547b3a7bbfe7 /lib/libproc
parent25971e06a21407c5ac4533772dc089fdb85b283b (diff)
downloadFreeBSD-src-756d4686b39ff2a93f1aab3ac223d5257ce6d7cc.zip
FreeBSD-src-756d4686b39ff2a93f1aab3ac223d5257ce6d7cc.tar.gz
Fix an off-by-one error when checking whether a given address is within
the extent of a symbol. Submitted by: Prashanth Kumar <pra_udupi@yahoo.co.in> Reviewed by: rpaulo MFC after: 1 week
Diffstat (limited to 'lib/libproc')
-rw-r--r--lib/libproc/proc_sym.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c
index 4f3d83b..87ac471 100644
--- a/lib/libproc/proc_sym.c
+++ b/lib/libproc/proc_sym.c
@@ -285,7 +285,7 @@ proc_addr2sym(struct proc_handle *p, uintptr_t addr, char *name,
* by rtld.
*/
rsym = map->pr_vaddr + sym.st_value;
- if (addr >= rsym && addr <= (rsym + sym.st_size)) {
+ if (addr >= rsym && addr < rsym + sym.st_size) {
s = elf_strptr(e, dynsymstridx, sym.st_name);
if (s) {
if (s[0] == '_' && s[1] == 'Z' && s[2])
@@ -325,7 +325,7 @@ symtab:
rsym = map->pr_vaddr + sym.st_value;
else
rsym = sym.st_value;
- if (addr >= rsym && addr <= (rsym + sym.st_size)) {
+ if (addr >= rsym && addr < rsym + sym.st_size) {
s = elf_strptr(e, symtabstridx, sym.st_name);
if (s) {
if (s[0] == '_' && s[1] == 'Z' && s[2])
OpenPOWER on IntegriCloud