]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Check for negative poll timeout in k5_sendto_kdc
authorGreg Hudson <ghudson@mit.edu>
Fri, 25 Jan 2013 18:11:27 +0000 (13:11 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 25 Jan 2013 18:11:27 +0000 (13:11 -0500)
ticket: 7553
target_version: 1.11.1
tags: pullup

src/lib/krb5/os/sendto_kdc.c

index d8b6a95963970899465696b73cb516d3a42a42cd..8488f6d6e05164e2693831fe44bc569f14590919 100644 (file)
@@ -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. */