gse_krb5: Avoid a segfault when we can not read the dedicated keytab file
authorAndrew Bartlett <abartlet@samba.org>
Thu, 27 Nov 2014 04:13:23 +0000 (17:13 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 27 Nov 2014 06:38:02 +0000 (07:38 +0100)
commit82c0ecbb2c45b9a38792ef9e5428522abc3dc71e
tree225262dc5537b661210f153a4907e7c28a133350
parent5ab6fa18a4e5fffd10c46824dbcd04dd87bbf2f4
gse_krb5: Avoid a segfault when we can not read the dedicated keytab file

This improved code simply cleans up the memory as soon as possible,
rather than using memcmp().  Otherwise, we segfault if
krb5_kt_start_seq_get fails, as it can set the fd element in the
handle to -1.

Change-Id: Ib4821ef944a7e12cd8a891ae07dbfc0567c65495
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Nov 27 07:38:02 CET 2014 on sn-devel-104
source3/librpc/crypto/gse_krb5.c
source3/script/tests/test_ntlm_auth_krb5.sh