Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/heimdal/dist/lib/krb5 CID 745290: check ...



details:   https://anonhg.NetBSD.org/src/rev/1c7155ee1e9b
branches:  trunk
changeset: 795919:1c7155ee1e9b
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 12 15:20:41 2014 +0000

description:
CID 745290: check return of fcntl

diffstat:

 crypto/external/bsd/heimdal/dist/lib/krb5/send_to_kdc.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r ef706e9a7384 -r 1c7155ee1e9b crypto/external/bsd/heimdal/dist/lib/krb5/send_to_kdc.c
--- a/crypto/external/bsd/heimdal/dist/lib/krb5/send_to_kdc.c   Mon May 12 13:49:24 2014 +0000
+++ b/crypto/external/bsd/heimdal/dist/lib/krb5/send_to_kdc.c   Mon May 12 15:20:41 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: send_to_kdc.c,v 1.1.1.2 2014/04/24 12:45:51 pettai Exp $       */
+/*     $NetBSD: send_to_kdc.c,v 1.2 2014/05/12 15:20:41 christos Exp $ */
 
 /*
  * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
@@ -62,7 +62,8 @@
     if (flags == -1)
        return -1;
 
-    fcntl(s, F_SETFL, flags | O_NONBLOCK);
+    if (fcntl(s, F_SETFL, flags | O_NONBLOCK)) == -1)
+       return -1;
     ret = connect(s, addr->ai_addr, addr->ai_addrlen);
     if (ret == -1 && errno != EINPROGRESS)
        return -1;
@@ -78,7 +79,8 @@
        if (ret != -1 || errno != EINTR)
            break;
     }
-    fcntl(s, F_SETFL, flags);
+    if (fcntl(s, F_SETFL, flags) == -1)
+       return -1;
 
     if (ret != 1)
        return -1;



Home | Main Index | Thread Index | Old Index