Skip to content

Commit

Permalink
Initialize err variable in krb5_sendto_kdc
Browse files Browse the repository at this point in the history
When we get an KRB5_KDC_UNREACH error back from k5_sendto, we check if
the err variable we passed for use by our message handler has been set
to KDC_ERR_SVC_UNAVAILABLE.  If k5_sendto doesn't receive any
response, though, the handler isn't called, so we're reading an
uninitialized variable.  Initialize it to a value other than
KDC_ERR_SVC_UNAVAILABLE to be sure.

[ghudson@mit.edu: initialize err just before calling k5_sendto; edit
commit message]

ticket: 7874 (new)
target_version: 1.12.2
tags: pullup
  • Loading branch information
nalind authored and greghudson committed Mar 13, 2014
1 parent 5fa7e66 commit 1ed3f68
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/krb5/os/sendto_kdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ krb5_sendto_kdc(krb5_context context, const krb5_data *message,
if (retval)
return retval;

err = 0;
retval = k5_sendto(context, message, &servers, socktype1, socktype2,
NULL, reply, NULL, NULL, &server_used,
check_for_svc_unavailable, &err);
Expand Down

0 comments on commit 1ed3f68

Please sign in to comment.