Skip to content

Commit 140a16d

Browse files
committed
prevent forward slashes only dentry names
1 parent 842d0e7 commit 140a16d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

volatility3/framework/symbols/linux/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,13 @@ def do_get_path(cls, rdentry, rmnt, dentry, vfsmnt) -> Union[None, str]:
190190

191191
parent = dentry.d_parent
192192
dname = dentry.d_name.name_as_str()
193-
path_reversed.append(dname.strip("/"))
193+
dname_stripped = dname.strip("/")
194+
if dname_stripped:
195+
path_reversed.append(dname_stripped)
194196
dentry = parent
195197

198+
if path_reversed == []:
199+
return ""
196200
path = "/" + "/".join(reversed(path_reversed))
197201
return path
198202

0 commit comments

Comments
 (0)