krb5 commit [krb5-1.11]: Check for negative poll timeout in k5_sendto_kdc

Tom Yu tlyu at MIT.EDU
Thu Jan 31 17:55:05 EST 2013


https://github.com/krb5/krb5/commit/7c4c3962bad878cf7aae9c03e20cfe2ddf7474e9
commit 7c4c3962bad878cf7aae9c03e20cfe2ddf7474e9
Author: Greg Hudson <ghudson at mit.edu>
Date:   Fri Jan 25 13:11:27 2013 -0500

    Check for negative poll timeout in k5_sendto_kdc
    
    (cherry picked from commit 74bee54227deb64a41c2e79f57dd2a2c5ea010a3)
    
    ticket: 7553
    version_fixed: 1.11.1
    status: resolved

 src/lib/krb5/os/sendto_kdc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c
index 22cd908..96991de 100644
--- a/src/lib/krb5/os/sendto_kdc.c
+++ b/src/lib/krb5/os/sendto_kdc.c
@@ -523,6 +523,10 @@ cm_select_or_poll(const struct select_state *in, struct select_state *out,
             return e;
         timeout = (in->end_time.tv_sec - now.tv_sec) * 1000 +
             (in->end_time.tv_usec - now.tv_usec) / 1000;
+        if (timeout < 0) {
+            *sret = 0;
+            return 0;
+        }
     }
     /* We don't need a separate copy of the selstate for poll, but use one
      * anyone for consistency with the select wrapper. */


More information about the cvs-krb5 mailing list