For example, if you try to extract /input/data, the script calculates subdir to be /nput/data which is incorrect and will cause an error later when it tries to make the directory /nput/data unless the directory /nput happens to exist.
I encountered this issue when running binwalk in a container, I understand that running it from the root directory is probably not a common use case.
If you run binwalk from the root directory the logic in https://github.com/ReFirmLabs/binwalk/blob/master/src/binwalk/modules/extractor.py#L557-L560 goes wrong because
self.directory='/'
which leads to the split path returning a list where the first item is an empty string.For example, if you try to extract
/input/data
, the script calculates subdir to be/nput/data
which is incorrect and will cause an error later when it tries to make the directory/nput/data
unless the directory/nput
happens to exist.I encountered this issue when running binwalk in a container, I understand that running it from the root directory is probably not a common use case.