Skip Menu |

Subject: git commit
Download (untitled) / with headers
text/plain 1.5KiB

Zero length fields when freeing object contents

In krb5_free_data_contents() and krb5_free_checksum_contents(), zero
the length as well as the data pointer to leave the object in a valid
state. Add asserts to existing test harnesses to verify the new

In the krb5 GSS mech's kg_checksum_channel_bindings(), remove the code
to reallocate the checksum with xmalloc(), as it relied on
krb5_free_checksum_contents() leaving the object in an invalid state.
This code was added in commit a30fb4c4400f13a2690df7ef910b7ac0ccbcf194
to match an xfree() call, but commit
29337e7c7b796685fb6a03466d32147e17aa2d16 replaced that xfree() with a
krb5_free_checksum_contents(). (In addition, the xmalloc and xfree
wrappers never evolved to do anything beyond malloc and free.)

In kpropd's recv_database(), don't free outbuf until we are done using
its length.

[ rewrote commit message; edited doxygen comment
changes to mention version]
Author: Isaac Boukris <>
Committer: Greg Hudson <>
Commit: 4a2c5d259f5a7eda0f0f9028c061fcd032a72de0
Branch: master
src/include/krb5/krb5.hin | 4 ++++
src/kprop/kpropd.c | 2 +-
src/lib/crypto/crypto_tests/t_cksums.c | 1 +
src/lib/gssapi/krb5/util_cksum.c | 16 ----------------
src/lib/krb5/krb/kfree.c | 8 ++++----
src/tests/rdreq.c | 2 ++
6 files changed, 12 insertions(+), 21 deletions(-)