krb5: Fix NULL-deref in send_to_kdc
Coverity thinks `handle` in lib/krb5/send_to_kdc.c:krb5_sendto_context() at 1241 can be NULL, leading to a NULL derefence in `get_next()`. This is an attempt to fix this by having `get_next()` check handle for NULL.
This commit is contained in:
@@ -438,7 +438,7 @@ krb5_krbhst_get_addrinfo(krb5_context context, krb5_krbhst_info *host,
|
||||
static krb5_boolean
|
||||
get_next(struct krb5_krbhst_data *kd, krb5_krbhst_info **host)
|
||||
{
|
||||
struct krb5_krbhst_info *hi = *kd->index;
|
||||
struct krb5_krbhst_info *hi = kd ? *kd->index : NULL;
|
||||
if(hi != NULL) {
|
||||
*host = hi;
|
||||
kd->index = &(*kd->index)->next;
|
||||
|
Reference in New Issue
Block a user