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]

(cherry picked from commit 1ed3f68)

ticket: 8088 (new)
version_fixed: 1.11.6
status: resolved
  • Loading branch information
nalind authored and tlyu committed Feb 6, 2015
1 parent 76b99c5 commit 2faf2b4
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 @@ -336,6 +336,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 2faf2b4

Please sign in to comment.