svn commit: r265074 - stable/9/lib/libproc
Mark Johnston
markj at FreeBSD.org
Tue Apr 29 03:37:30 UTC 2014
Author: markj
Date: Tue Apr 29 03:37:30 2014
New Revision: 265074
URL: http://svnweb.freebsd.org/changeset/base/265074
Log:
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.
Modified:
stable/9/lib/libproc/proc_sym.c
Directory Properties:
stable/9/lib/libproc/ (props changed)
Modified: stable/9/lib/libproc/proc_sym.c
==============================================================================
--- stable/9/lib/libproc/proc_sym.c Tue Apr 29 03:36:04 2014 (r265073)
+++ stable/9/lib/libproc/proc_sym.c Tue Apr 29 03:37:30 2014 (r265074)
@@ -74,7 +74,7 @@ proc_objname(struct proc_handle *p, uint
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);
}
@@ -154,7 +154,7 @@ proc_addr2map(struct proc_handle *p, uin
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);
@@ -187,7 +187,7 @@ proc_addr2map(struct proc_handle *p, uin
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);
More information about the svn-src-stable-9
mailing list