Date: Tue, 29 Oct 2013 03:52:06 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257300 - head/lib/libproc Message-ID: <201310290352.r9T3q6JK077142@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Oct 29 03:52:05 2013 New Revision: 257300 URL: http://svnweb.freebsd.org/changeset/base/257300 Log: 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 Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Oct 29 03:42:43 2013 (r257299) +++ head/lib/libproc/proc_sym.c Tue Oct 29 03:52:05 2013 (r257300) @@ -285,7 +285,7 @@ proc_addr2sym(struct proc_handle *p, uin * 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])
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310290352.r9T3q6JK077142>