Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/libexec/ftpd CID 603440: ensure that closing socket exists
details: https://anonhg.NetBSD.org/src/rev/e7e8eff4a087
branches: trunk
changeset: 346574:e7e8eff4a087
user: shm <shm%NetBSD.org@localhost>
date: Tue Jul 19 21:25:38 2016 +0000
description:
CID 603440: ensure that closing socket exists
diffstat:
libexec/ftpd/ftpd.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 07b2fa7296d2 -r e7e8eff4a087 libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c Tue Jul 19 18:54:45 2016 +0000
+++ b/libexec/ftpd/ftpd.c Tue Jul 19 21:25:38 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpd.c,v 1.202 2015/08/10 07:32:49 shm Exp $ */
+/* $NetBSD: ftpd.c,v 1.203 2016/07/19 21:25:38 shm Exp $ */
/*
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
#if 0
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: ftpd.c,v 1.202 2015/08/10 07:32:49 shm Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.203 2016/07/19 21:25:38 shm Exp $");
#endif
#endif /* not lint */
@@ -1967,7 +1967,8 @@
t = errno;
if (! dropprivs)
(void) seteuid((uid_t)pw->pw_uid);
- (void) close(s);
+ if (s >= 0)
+ (void) close(s);
errno = t;
return (NULL);
}
Home |
Main Index |
Thread Index |
Old Index