tytso / e2fsprogs

Ext2/3/4 file system utilities
http://ext4.wiki.kernel.org
373 stars 219 forks source link

Checking the source code with a static analyzer #188

Open Yugend opened 3 months ago

Yugend commented 3 months ago

Hello! I checked the source code of e2fsprogs using a static analyzer and found a couple of suspicious places. Here they are:

  1. misc/e4crypt.c file, 225 line. The memset() call will be deleted by compiler in release build and sensitive data won`t be deleted.

  2. misc/badblocks.c file, 806 line. If I understand correctly, this loop is never executed because of num_saved=0 in 786 line. It is an old code, so I assume it works correctly, but it looks strange to me and I decided to mention it.

Thank you in advance for the answer, and I apologize for bothering you if I'm wrong.