Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/rpc CID 1338520: Check NULL



details:   https://anonhg.NetBSD.org/src/rev/4cd329f1bd59
branches:  trunk
changeset: 811673:4cd329f1bd59
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 10 18:11:05 2015 +0000

description:
CID 1338520: Check NULL
CID 1338521: Fix error (realloc returns different pointer)

diffstat:

 lib/libc/rpc/svc_fdset.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r 7bb4dd0ab9cd -r 4cd329f1bd59 lib/libc/rpc/svc_fdset.c
--- a/lib/libc/rpc/svc_fdset.c  Tue Nov 10 18:08:05 2015 +0000
+++ b/lib/libc/rpc/svc_fdset.c  Tue Nov 10 18:11:05 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $  */
+/*     $NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $  */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: svc_fdset.c,v 1.13 2015/11/10 18:08:05 christos Exp $");
+__RCSID("$NetBSD: svc_fdset.c,v 1.14 2015/11/10 18:11:05 christos Exp $");
 
 
 #include "reentrant.h"
@@ -215,6 +215,7 @@
        fds->fdused = fds->fdnum + 1;
        DPRINTF("add fd=%d slot=%d fdused=%d", fd, fds->fdnum, fds->fdused);
        fds->fdnum += FD_SETSIZE;
+       fds->fdp = pfd;
        return fds;
 }
 
@@ -323,6 +324,8 @@
        DPRINTF("zero");
 
        struct svc_fdset *fds = svc_fdset_alloc(0);
+       if (fds == NULL)
+               return;
        memset(fds->fdset, 0, fds->fdsize);
        fds->fdmax = -1;
 



Home | Main Index | Thread Index | Old Index