Module Name:    src
Committed By:   christos
Date:           Tue Nov 10 18:11:05 UTC 2015

Modified Files:
        src/lib/libc/rpc: svc_fdset.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/rpc/svc_fdset.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/rpc/svc_fdset.c
diff -u src/lib/libc/rpc/svc_fdset.c:1.13 src/lib/libc/rpc/svc_fdset.c:1.14
--- src/lib/libc/rpc/svc_fdset.c:1.13	Tue Nov 10 13:08:05 2015
+++ src/lib/libc/rpc/svc_fdset.c	Tue Nov 10 13:11:05 2015
@@ -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 @@ svc_pollfd_add(int fd, struct svc_fdset 
 	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 @@ svc_fdset_zero(void)
 	DPRINTF("zero");
 
 	struct svc_fdset *fds = svc_fdset_alloc(0);
+	if (fds == NULL)
+		return;
 	memset(fds->fdset, 0, fds->fdsize);
 	fds->fdmax = -1;
 

Reply via email to