kdc: Fix ‘header_key’ may be used uninitialized in this function
commit8ed36cee5c533d55cd7fb1705c6a20fbb2dc5ca6
authorAndrew Bartlett <abartlet@samba.org>
Wed, 24 Nov 2021 04:23:09 +0000 (24 17:23 +1300)
committerJeffrey Altman <jaltman@auristor.com>
Wed, 24 Nov 2021 07:51:12 +0000 (24 02:51 -0500)
treef62ee9ddd22e27ea1c69352addb061e6113f8b3a
parent232c936ea3eabfd702aaaa106ddf9474f231d776
kdc: Fix ‘header_key’ may be used uninitialized in this function

krb5tgs.c: In function ‘_kdc_tgs_rep’:
krb5tgs.c:1785:25: warning: ‘header_key’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1785 |       &tkey_check->key, &tkey_check->key, tgt, &kdc_issued, &mspac);
      |                         ^~~~~~~~~~~~~~~~
krb5tgs.c:2302:10: note: ‘header_key’ was declared here
 2302 |     Key *header_key;
      |          ^~~~~~~~~~

On Ubuntu 20.04 in a default Heimdal build with
gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)

The compiler doesn't trust that *header_key = tkey; is always
executed in tgs_parse_request() for ret == 0.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
kdc/krb5tgs.c