summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-04-29 03:36:04 +0000
committermarkj <markj@FreeBSD.org>2014-04-29 03:36:04 +0000
commit652284a3437382775ff53cc6c4daaf304cedc247 (patch)
tree4c271630f0398b85c239166fddd2f224102fd98b /lib
parent3e706bc125f903c2223e90e5225594efea13e10f (diff)
downloadFreeBSD-src-652284a3437382775ff53cc6c4daaf304cedc247.zip
FreeBSD-src-652284a3437382775ff53cc6c4daaf304cedc247.tar.gz
MFC r264436:
Fix some off-by-one errors. The kve_end and rdl_eaddr fields contain the first address after the end of the map entry and should therefore be excluded.
Diffstat (limited to 'lib')
-rw-r--r--lib/libproc/proc_sym.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c
index f848040..2338895 100644
--- a/lib/libproc/proc_sym.c
+++ b/lib/libproc/proc_sym.c
@@ -96,7 +96,7 @@ proc_objname(struct proc_handle *p, uintptr_t addr, char *objname,
for (i = 0; i < p->nobjs; i++) {
rdl = &p->rdobjs[i];
- if (addr >= rdl->rdl_saddr && addr <= rdl->rdl_eaddr) {
+ if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) {
strlcpy(objname, rdl->rdl_path, objnamesz);
return (objname);
}
@@ -176,7 +176,7 @@ proc_addr2map(struct proc_handle *p, uintptr_t addr)
kve = kves + i;
if (kve->kve_type == KVME_TYPE_VNODE)
lastvn = i;
- if (addr >= kve->kve_start && addr <= kve->kve_end) {
+ if (addr >= kve->kve_start && addr < kve->kve_end) {
if ((map = malloc(sizeof(*map))) == NULL) {
free(kves);
return (NULL);
@@ -209,7 +209,7 @@ proc_addr2map(struct proc_handle *p, uintptr_t addr)
for (i = 0; i < p->nobjs; i++) {
rdl = &p->rdobjs[i];
- if (addr >= rdl->rdl_saddr && addr <= rdl->rdl_eaddr) {
+ if (addr >= rdl->rdl_saddr && addr < rdl->rdl_eaddr) {
if ((map = malloc(sizeof(*map))) == NULL)
return (NULL);
proc_rdl2prmap(rdl, map);
OpenPOWER on IntegriCloud