aboutsummaryrefslogtreecommitdiff
path: root/lib/librtld_db
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2020-06-05 18:44:14 +0000
committerMark Johnston <markj@FreeBSD.org>2020-06-05 18:44:14 +0000
commit13776bf7362b14dc3a5abdb19be7d6adafba7326 (patch)
tree60a7b09d4e799163017d11a1a1dd5fba27a74ec0 /lib/librtld_db
parent16c0b6eef9c785412e677fd7fd109c99612b2d05 (diff)
downloadsrc-13776bf7362b14dc3a5abdb19be7d6adafba7326.tar.gz
src-13776bf7362b14dc3a5abdb19be7d6adafba7326.zip
Notes
Diffstat (limited to 'lib/librtld_db')
-rw-r--r--lib/librtld_db/rtld_db.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/librtld_db/rtld_db.c b/lib/librtld_db/rtld_db.c
index fc4ad8f4834b..9edeecfb95c5 100644
--- a/lib/librtld_db/rtld_db.c
+++ b/lib/librtld_db/rtld_db.c
@@ -186,11 +186,15 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data)
* file, but we want the mapping offset relative to the base
* mapping.
*/
- if (kve->kve_type == KVME_TYPE_VNODE &&
- kve->kve_vn_fileid != fileid) {
- base = kve->kve_start;
- fileid = kve->kve_vn_fileid;
- path = kve->kve_path;
+ if (kve->kve_type == KVME_TYPE_VNODE) {
+ if (kve->kve_vn_fileid != fileid) {
+ base = kve->kve_start;
+ fileid = kve->kve_vn_fileid;
+ path = kve->kve_path;
+ }
+ } else {
+ base = 0;
+ path = NULL;
}
memset(&rdl, 0, sizeof(rdl));
/*
@@ -205,7 +209,8 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data)
rdl.rdl_prot |= RD_RDL_W;
if (kve->kve_protection & KVME_PROT_EXEC)
rdl.rdl_prot |= RD_RDL_X;
- strlcpy(rdl.rdl_path, path, sizeof(rdl.rdl_path));
+ if (path != NULL)
+ strlcpy(rdl.rdl_path, path, sizeof(rdl.rdl_path));
if ((*cb)(&rdl, clnt_data) != 0) {
ret = RD_ERR;
break;