I should have been clearer originally - this particular patch isn't my work, it was suggested upstream in https://sourceforge.net/p/dump/bugs/174/
I picked it up while trying to fix the uninitialized read bug #1081009. That patch changes the same lines of code in one place so it was slightly easier for me to keep this patch rather than rework the other one which is why I've now reported it here now. My only contribution is a small testcase that doesn't require 12TB of data to reproduce.