resurrecting-open-source-projects / dcfldd

Enhanced version of dd for forensics and security
GNU General Public License v2.0
90 stars 19 forks source link

Fix memory leaks #32

Closed lucic71 closed 2 months ago

lucic71 commented 3 months ago

hashstr_buf also seems to be read in a lot of places but never written.

Edit: hastype_t.final, which usee hashstr_buf, isn't written anywhere, as well.

davidpolverari commented 3 months ago

Hmm. For this one, I will leave it for the time when I'm able to run it through valgrind and gdb (probably over the weekend) and see whether data is ever written on those locations.

hartwork commented 3 months ago

@davidpolverari unfixed compile warnings in the CI logs seem to confirm. This is for latest master:

2024-05-08T02:42:50.0167219Z verify.c:147:11: warning: variable 'i_hashstr_buf' set but not used [-Wunused-but-set-variable]
2024-05-08T02:42:50.0167811Z   147 |     char *i_hashstr_buf;
2024-05-08T02:42:50.0168195Z       |           ^
2024-05-08T02:42:50.0168870Z verify.c:148:11: warning: variable 'v_hashstr_buf' set but not used [-Wunused-but-set-variable]
2024-05-08T02:42:50.0169458Z   148 |     char *v_hashstr_buf;
2024-05-08T02:42:50.0169840Z       |           ^
davidpolverari commented 2 months ago

Merged on master. Closing manually, as I had to rebase before merging. Thanks for the help!