AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

rdsquashfs -d nasty.sqfs asserts #52

Closed Dr-Emann closed 4 years ago

Dr-Emann commented 4 years ago

I don't know if this counts as an issue: mknastyfs intentionally creates an ugly filesystem.

When calling rdsquashfs -d on the output of mknastyfs, the program aborts due to an assert on this line in the print_name function: https://github.com/AgentD/squashfs-tools-ng/blob/09727f7523761cf57d8b90042af78088f0d4ef7f/bin/rdsquashfs/describe.c#L20

AgentD commented 4 years ago

Hi!

The assert is triggered because nasty.sqfs contains a file named ... The unpack code path already checks for illegal file names and issues an error message, the code for the describe option does not and only relies on an assert.

This and other asserts should be removed from the code base and replaced with proper error handling, not only for usability, but also for the case where the code is compiled with -DNDEBUG.

The rdsquashfs describe issue should be fixed in commit b96c4240ae6bddb4c929115cbd7d31698d72a5f7.

Thanks!