]> git.ipfire.org Git - thirdparty/krb5.git/commit
Improve code hygiene of kdb5_util dump helpers 866/head
authorGreg Hudson <ghudson@mit.edu>
Thu, 25 Oct 2018 16:55:50 +0000 (12:55 -0400)
committerGreg Hudson <ghudson@mit.edu>
Fri, 26 Oct 2018 14:24:16 +0000 (10:24 -0400)
commite91359aead19f432e5fbc99054a793e983f58328
tree6dc193646cffc07f38fba0cd961d9657003d7938
parent597f18953367bbc246fbb0222355a7a94ffff6b4
Improve code hygiene of kdb5_util dump helpers

kdb5_util dump can very briefly leak a file handle if the ok file
cannot be locked, or if the existing dump file cannot be read.  Add a
cleanup handler to prep_ok_file() and use proper output parameter
handling.  Change current_dump_sno_in_ulog() to close its file handle
before checking the result of fgets().  Reported by Bean Zhang.
src/kadmin/dbutil/dump.c