Date: Tue, 29 Apr 2014 03:37:30 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r265074 - stable/9/lib/libproc Message-ID: <201404290337.s3T3bUjT003541@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404290337.s3T3bUjT003541>