From 2d029408aa398abc057f1b032c0a5b27e4b9cc74 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Tue, 30 Jun 1998 16:09:08 +0000 Subject: [PATCH] (do_request): check for errors from `sendto' git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5049 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kdc/connect.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kdc/connect.c b/kdc/connect.c index 6b5a4d81c..3033ff871 100644 --- a/kdc/connect.c +++ b/kdc/connect.c @@ -312,9 +312,17 @@ do_request(void *buf, size_t len, int sendlength, len[1] = (reply.length >> 16) & 0xff; len[2] = (reply.length >> 8) & 0xff; len[3] = reply.length & 0xff; - sendto(socket, len, sizeof(len), 0, from, from_len); + if(sendto(socket, len, sizeof(len), 0, from, from_len) < 0) { + kdc_log (0, "sendto(%s): %s", addr, strerror(errno)); + krb5_data_free(&reply); + return; + } + } + if(sendto(socket, reply.data, reply.length, 0, from, from_len) < 0) { + kdc_log (0, "sendto(%s): %s", addr, strerror(errno)); + krb5_data_free(&reply); + return; } - sendto(socket, reply.data, reply.length, 0, from, from_len); krb5_data_free(&reply); } if(ret)