CVS commit: src/sys/external/bsd/dwc2

2013-11-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Nov 19 10:07:11 UTC 2013

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
Zeroise the whole urb including the iso_descs array


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/external/bsd/dwc2/dwc2.c

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

Modified files:

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.19 src/sys/external/bsd/dwc2/dwc2.c:1.20
--- src/sys/external/bsd/dwc2/dwc2.c:1.19	Tue Nov 19 07:50:01 2013
+++ src/sys/external/bsd/dwc2/dwc2.c	Tue Nov 19 10:07:11 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.19 2013/11/19 07:50:01 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.20 2013/11/19 10:07:11 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dwc2.c,v 1.19 2013/11/19 07:50:01 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: dwc2.c,v 1.20 2013/11/19 10:07:11 skrll Exp $);
 
 #include opt_usb.h
 
@@ -1294,7 +1294,8 @@ dwc2_device_start(usbd_xfer_handle xfer)
 	if (!dwc2_urb)
 		return USBD_NOMEM;
 
-	memset(dwc2_urb, 0, sizeof(*dwc2_urb));
+	memset(dwc2_urb, 0, sizeof(*dwc2_urb) +
+	sizeof(dwc2_urb-iso_descs[0]) * DWC2_MAXISOCPACKETS);
 
 	dwc2_urb-priv = xfer;
 	dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, addr, epnum, xfertype, dir,



CVS commit: src/sys/dev/sbus

2013-11-19 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Tue Nov 19 10:49:00 UTC 2013

Modified Files:
src/sys/dev/sbus: p9100.c

Log Message:
get rid of junk variable


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/sbus/p9100.c

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

Modified files:

Index: src/sys/dev/sbus/p9100.c
diff -u src/sys/dev/sbus/p9100.c:1.59 src/sys/dev/sbus/p9100.c:1.60
--- src/sys/dev/sbus/p9100.c:1.59	Sat Oct 27 17:18:37 2012
+++ src/sys/dev/sbus/p9100.c	Tue Nov 19 10:49:00 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: p9100.c,v 1.59 2012/10/27 17:18:37 chs Exp $ */
+/*	$NetBSD: p9100.c,v 1.60 2013/11/19 10:49:00 macallan Exp $ */
 
 /*-
  * Copyright (c) 1998, 2005, 2006 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: p9100.c,v 1.59 2012/10/27 17:18:37 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: p9100.c,v 1.60 2013/11/19 10:49:00 macallan Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -114,7 +114,6 @@ struct p9100_softc {
 #ifdef PNOZZ_USE_LATCH
 	bus_space_handle_t sc_fb_memh;	/*   bus space handle */
 #endif
-	volatile uint32_t sc_junk;
 	uint32_t 	sc_mono_width;	/* for setup_mono */
 
 	uint32_t	sc_width;
@@ -262,9 +261,8 @@ struct wsdisplay_accessops p9100_accesso
 
 #ifdef PNOZZ_USE_LATCH
 #define PNOZZ_LATCH(sc, off) if(sc-sc_last_offset != (off  0xff80)) { \
-		sc-sc_junk = bus_space_read_4(sc-sc_bustag, sc-sc_fb_memh, \
-		off); \
-		sc-sc_last_offset = off  0xff80; }
+	(void)bus_space_read_4(sc-sc_bustag, sc-sc_fb_memh, off); \
+	sc-sc_last_offset = off  0xff80; }
 #else
 #define PNOZZ_LATCH(a, b)
 #endif
@@ -791,7 +789,7 @@ p9100_bitblt(void *cookie, int xs, int y
 	p9100_ctl_write_4(sc, ABS_XY2, dst  sc-sc_depthshift);
 	p9100_ctl_write_4(sc, ABS_XY3, dstw  sc-sc_depthshift);
 
-	sc-sc_junk = p9100_ctl_read_4(sc, COMMAND_BLIT);
+	(void)p9100_ctl_read_4(sc, COMMAND_BLIT);
 }
 
 /* solid rectangle fill */
@@ -813,7 +811,7 @@ p9100_rectfill(void *cookie, int xs, int
 	p9100_ctl_write_4(sc, COORD_INDEX, 0);
 	p9100_ctl_write_4(sc, RECT_RTW_XY, src);
 	p9100_ctl_write_4(sc, RECT_RTW_XY, srcw);
-	sc-sc_junk = p9100_ctl_read_4(sc, COMMAND_QUAD);
+	(void)p9100_ctl_read_4(sc, COMMAND_QUAD);
 }
 
 /* setup for mono-colour expansion */
@@ -892,7 +890,7 @@ static uint8_t
 p9100_ramdac_read(struct p9100_softc *sc, bus_size_t off)
 {
 
-	sc-sc_junk = p9100_ctl_read_4(sc, PWRUP_CNFG);
+	(void)p9100_ctl_read_4(sc, PWRUP_CNFG);
 	return ((bus_space_read_4(sc-sc_bustag,
 	sc-sc_ctl_memh, off)  16)  0xff);
 }
@@ -901,7 +899,7 @@ static void
 p9100_ramdac_write(struct p9100_softc *sc, bus_size_t off, uint8_t v)
 {
 
-	sc-sc_junk = p9100_ctl_read_4(sc, PWRUP_CNFG);
+	(void)p9100_ctl_read_4(sc, PWRUP_CNFG);
 	bus_space_write_4(sc-sc_bustag, sc-sc_ctl_memh, off,
 	((uint32_t)v)  16);
 }



CVS commit: xsrc/external/mit/xterm/include

2013-11-19 Thread Thomas Klausner
Module Name:xsrc
Committed By:   wiz
Date:   Tue Nov 19 11:56:13 UTC 2013

Modified Files:
xsrc/external/mit/xterm/include: xtermcfg.h

Log Message:
Enable 256 colors.

From Piotr Meyer in PR 48380.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 xsrc/external/mit/xterm/include/xtermcfg.h

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

Modified files:

Index: xsrc/external/mit/xterm/include/xtermcfg.h
diff -u xsrc/external/mit/xterm/include/xtermcfg.h:1.6 xsrc/external/mit/xterm/include/xtermcfg.h:1.7
--- xsrc/external/mit/xterm/include/xtermcfg.h:1.6	Thu Jul 11 20:02:24 2013
+++ xsrc/external/mit/xterm/include/xtermcfg.h	Tue Nov 19 11:56:13 2013
@@ -111,7 +111,7 @@
 #define LUIT_PATH /usr/X11R7/bin/luit	/* CF_ARG_ENABLE(luit) */
 /* #undef NO_ACTIVE_ICON */		/* CF_ARG_DISABLE(active-icon) */
 /* #undef NO_LEAKS */			/* CF_ARG_DISABLE(leaks) */
-/* #undef OPT_256_COLORS */		/* CF_ARG_ENABLE(256-color) */
+#define OPT_256_COLORS 1		/* CF_ARG_ENABLE(256-color) */
 /* #undef OPT_88_COLORS */		/* CF_ARG_ENABLE(88-color) */
 /* #undef OPT_AIX_COLORS */		/* CF_ARG_DISABLE(16-color) */
 /* #undef OPT_BLINK_CURS */		/* CF_ARG_DISABLE(blink-cursor) */



CVS commit: src/distrib/sets/lists/modules

2013-11-19 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Nov 19 12:07:06 UTC 2013

Modified Files:
src/distrib/sets/lists/modules: md.evbppc

Log Message:
Add smsc to ibm4xx and booke.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/distrib/sets/lists/modules/md.evbppc

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

Modified files:

Index: src/distrib/sets/lists/modules/md.evbppc
diff -u src/distrib/sets/lists/modules/md.evbppc:1.36 src/distrib/sets/lists/modules/md.evbppc:1.37
--- src/distrib/sets/lists/modules/md.evbppc:1.36	Mon Nov 18 16:23:47 2013
+++ src/distrib/sets/lists/modules/md.evbppc	Tue Nov 19 12:07:06 2013
@@ -1,4 +1,4 @@
-# $NetBSD: md.evbppc,v 1.36 2013/11/18 16:23:47 bad Exp $
+# $NetBSD: md.evbppc,v 1.37 2013/11/19 12:07:06 kiyohara Exp $
 ./stand/powerpc-4xx			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules	base-kernel-modules	kmod,compatmodules
@@ -80,6 +80,8 @@
 ./stand/powerpc-4xx/@OSRELEASE@/modules/if_axen/if_axen.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/if_npflog			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/if_npflog/if_npflog.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/if_smscbase-kernel-modules	kmod,compatmodules
+./stand/powerpc-4xx/@OSRELEASE@/modules/if_smsc/if_smsc.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-4xx/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules
@@ -285,6 +287,8 @@
 ./stand/powerpc-booke/@OSRELEASE@/modules/if_axen/if_axen.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/if_npflog			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/if_npflog/if_npflog.kmod	base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/modules/if_smsc			base-kernel-modules	kmod,compatmodules
+./stand/powerpc-booke/@OSRELEASE@/modules/if_smsc/if_smsc.kmod		base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iicbase-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iic/iic.kmod			base-kernel-modules	kmod,compatmodules
 ./stand/powerpc-booke/@OSRELEASE@/modules/iscsibase-kernel-modules	kmod,compatmodules



CVS commit: src/sys/arch/powerpc/ibm4xx

2013-11-19 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Tue Nov 19 12:46:43 UTC 2013

Modified Files:
src/sys/arch/powerpc/ibm4xx: pic_uic.c

Log Message:
Fix IPL for cascading pic to HIGH.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/powerpc/ibm4xx/pic_uic.c

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/pic_uic.c
diff -u src/sys/arch/powerpc/ibm4xx/pic_uic.c:1.3 src/sys/arch/powerpc/ibm4xx/pic_uic.c:1.4
--- src/sys/arch/powerpc/ibm4xx/pic_uic.c:1.3	Wed Feb  1 09:54:02 2012
+++ src/sys/arch/powerpc/ibm4xx/pic_uic.c	Tue Nov 19 12:46:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pic_uic.c,v 1.3 2012/02/01 09:54:02 matt Exp $	*/
+/*	$NetBSD: pic_uic.c,v 1.4 2013/11/19 12:46:43 kiyohara Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pic_uic.c,v 1.3 2012/02/01 09:54:02 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pic_uic.c,v 1.4 2013/11/19 12:46:43 kiyohara Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -213,7 +213,7 @@ extern struct pic_ops pic_uic1;
 static void
 uic1_finish_setup(struct pic_ops *pic)
 {
-	intr_establish(30, IST_LEVEL, IPL_NONE, pic_handle_intr, pic_uic1);
+	intr_establish(30, IST_LEVEL, IPL_HIGH, pic_handle_intr, pic_uic1);
 }
 
 struct uic uic1 = {
@@ -268,7 +268,7 @@ extern struct pic_ops pic_uic2;
 static void
 uic2_finish_setup(struct pic_ops *pic)
 {
-	intr_establish(28, IST_LEVEL, IPL_NONE, pic_handle_intr, pic_uic2);
+	intr_establish(28, IST_LEVEL, IPL_HIGH, pic_handle_intr, pic_uic2);
 }
 
 static struct uic uic2 = {



CVS commit: src/lib/libm/src

2013-11-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Nov 19 14:02:59 UTC 2013

Modified Files:
src/lib/libm/src: e_fmod.c

Log Message:
Alias to fmod for platforms with double == long double


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/e_fmod.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/libm/src/e_fmod.c
diff -u src/lib/libm/src/e_fmod.c:1.11 src/lib/libm/src/e_fmod.c:1.12
--- src/lib/libm/src/e_fmod.c:1.11	Sun May 26 22:01:49 2002
+++ src/lib/libm/src/e_fmod.c	Tue Nov 19 14:02:59 2013
@@ -12,7 +12,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBM_SCCS)  !defined(lint)
-__RCSID($NetBSD: e_fmod.c,v 1.11 2002/05/26 22:01:49 wiz Exp $);
+__RCSID($NetBSD: e_fmod.c,v 1.12 2013/11/19 14:02:59 joerg Exp $);
 #endif
 
 /*
@@ -26,6 +26,10 @@ __RCSID($NetBSD: e_fmod.c,v 1.11 2002/0
 
 static const double one = 1.0, Zero[] = {0.0, -0.0,};
 
+#ifndef __HAVE_LONG_DOUBLE
+__strong_alias(__ieee754_fmodl, __ieee754_fmod)
+#endif
+
 double
 __ieee754_fmod(double x, double y)
 {



CVS commit: src/lib/libm/src

2013-11-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Nov 19 14:04:24 UTC 2013

Modified Files:
src/lib/libm/src: k_standard.c w_fmodl.c

Log Message:
Report correct exception for fmodl.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libm/src/k_standard.c
cvs rdiff -u -r1.2 -r1.3 src/lib/libm/src/w_fmodl.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/libm/src/k_standard.c
diff -u src/lib/libm/src/k_standard.c:1.17 src/lib/libm/src/k_standard.c:1.18
--- src/lib/libm/src/k_standard.c:1.17	Mon Apr 11 15:17:33 2011
+++ src/lib/libm/src/k_standard.c	Tue Nov 19 14:04:24 2013
@@ -12,7 +12,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBM_SCCS)  !defined(lint)
-__RCSID($NetBSD: k_standard.c,v 1.17 2011/04/11 15:17:33 drochner Exp $);
+__RCSID($NetBSD: k_standard.c,v 1.18 2013/11/19 14:04:24 joerg Exp $);
 #endif
 
 #include math.h
@@ -532,9 +532,15 @@ __kernel_standard(double x, double y, in
 		break;
 case 27:
 	case 127:
+	case 227:
 /* fmod(x,0) */
 exc.type = DOMAIN;
-exc.name = type  100 ? fmod : fmodf;
+		if (type == 27)
+			exc.name = fmod;
+		else if (type == 127)
+			exc.name = fmodf;
+		else
+			exc.name = fmodl;
 if (_LIB_VERSION == _SVID_)
 exc.retval = x;
 		else

Index: src/lib/libm/src/w_fmodl.c
diff -u src/lib/libm/src/w_fmodl.c:1.2 src/lib/libm/src/w_fmodl.c:1.3
--- src/lib/libm/src/w_fmodl.c:1.2	Wed Nov 13 01:03:08 2013
+++ src/lib/libm/src/w_fmodl.c	Tue Nov 19 14:04:24 2013
@@ -11,7 +11,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: w_fmodl.c,v 1.2 2013/11/13 01:03:08 joerg Exp $);
+__RCSID($NetBSD: w_fmodl.c,v 1.3 2013/11/19 14:04:24 joerg Exp $);
 
 /*
  * wrapper fmodl(x,y)
@@ -37,7 +37,7 @@ fmodl(long double x, long double y)	/* w
 	z = __ieee754_fmodl(x,y);
 	if(_LIB_VERSION == _IEEE_ ||isnan(y)||isnan(x)) return z;
 	if(y==0.0) {
-	return __kernel_standard(x,y,27); /* fmod(x,0) */
+	return __kernel_standard(x,y,227); /* fmod(x,0) */
 	} else
 	return z;
 #endif



CVS commit: src/usr.sbin/ldpd

2013-11-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov 19 16:42:16 UTC 2013

Modified Files:
src/usr.sbin/ldpd: conffile.c

Log Message:
CVE 1129617: negative arg


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/ldpd/conffile.c

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

Modified files:

Index: src/usr.sbin/ldpd/conffile.c
diff -u src/usr.sbin/ldpd/conffile.c:1.10 src/usr.sbin/ldpd/conffile.c:1.11
--- src/usr.sbin/ldpd/conffile.c:1.10	Wed Nov 13 16:22:46 2013
+++ src/usr.sbin/ldpd/conffile.c	Tue Nov 19 11:42:16 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: conffile.c,v 1.10 2013/11/13 21:22:46 christos Exp $ */
+/* $NetBSD: conffile.c,v 1.11 2013/11/19 16:42:16 christos Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -122,7 +122,8 @@ conf_parsefile(const char *fname)
 	if (confh == -1 || fstat(confh, fs) == -1 ||
 	(mapped = mmap(NULL, fs.st_size, PROT_READ, MAP_SHARED, confh, 0))
 	== MAP_FAILED) {
-		close(confh);
+		if (confh != -1)
+			close(confh);
 		return E_CONF_IO;
 	}
 



CVS commit: src/sys/lib/libkern

2013-11-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov 19 16:56:21 UTC 2013

Modified Files:
src/sys/lib/libkern: kern_assert.c

Log Message:
For the purposes of static analysis, this never returns.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/lib/libkern/kern_assert.c

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

Modified files:

Index: src/sys/lib/libkern/kern_assert.c
diff -u src/sys/lib/libkern/kern_assert.c:1.2 src/sys/lib/libkern/kern_assert.c:1.3
--- src/sys/lib/libkern/kern_assert.c:1.2	Thu Sep 29 16:50:09 2011
+++ src/sys/lib/libkern/kern_assert.c	Tue Nov 19 11:56:21 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_assert.c,v 1.2 2011/09/29 20:50:09 christos Exp $	*/
+/*	$NetBSD: kern_assert.c,v 1.3 2013/11/19 16:56:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou
@@ -38,6 +38,7 @@
 #include lib/libkern/libkern.h
 #endif
 
+/* coverity[+kill] */
 void
 kern_assert(const char *fmt, ...)
 {



CVS commit: src/crypto/external/bsd/openssh/dist

2013-11-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov 19 16:58:16 UTC 2013

Modified Files:
src/crypto/external/bsd/openssh/dist: sftp-client.c

Log Message:
CID 1129615: close argument can't be negative


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/crypto/external/bsd/openssh/dist/sftp-client.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/sftp-client.c
diff -u src/crypto/external/bsd/openssh/dist/sftp-client.c:1.10 src/crypto/external/bsd/openssh/dist/sftp-client.c:1.11
--- src/crypto/external/bsd/openssh/dist/sftp-client.c:1.10	Mon Nov 11 11:46:20 2013
+++ src/crypto/external/bsd/openssh/dist/sftp-client.c	Tue Nov 19 11:58:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sftp-client.c,v 1.10 2013/11/11 16:46:20 christos Exp $	*/
+/*	$NetBSD: sftp-client.c,v 1.11 2013/11/19 16:58:16 christos Exp $	*/
 /* $OpenBSD: sftp-client.c,v 1.101.2.1 2013/11/08 01:33:56 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller d...@openbsd.org
@@ -22,7 +22,7 @@
 /* XXX: copy between two remote sites */
 
 #include includes.h
-__RCSID($NetBSD: sftp-client.c,v 1.10 2013/11/11 16:46:20 christos Exp $);
+__RCSID($NetBSD: sftp-client.c,v 1.11 2013/11/19 16:58:16 christos Exp $);
 #include sys/types.h
 #include sys/poll.h
 #include sys/queue.h
@@ -1069,7 +1069,8 @@ do_download(struct sftp_conn *conn, char
 			do_close(conn, handle, handle_len);
 			buffer_free(msg);
 			free(handle);
-			close(local_fd);
+			if (local_fd != -1)
+close(local_fd);
 			return -1;
 		}
 		offset = highwater = st.st_size;



CVS commit: src/usr.sbin/npf/npfctl

2013-11-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov 19 17:01:45 UTC 2013

Modified Files:
src/usr.sbin/npf/npfctl: npf_show.c

Log Message:
CID 1129614: dereference after null


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/npf/npfctl/npf_show.c

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_show.c
diff -u src/usr.sbin/npf/npfctl/npf_show.c:1.5 src/usr.sbin/npf/npfctl/npf_show.c:1.6
--- src/usr.sbin/npf/npfctl/npf_show.c:1.5	Mon Nov 18 19:28:41 2013
+++ src/usr.sbin/npf/npfctl/npf_show.c	Tue Nov 19 12:01:45 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_show.c,v 1.5 2013/11/19 00:28:41 rmind Exp $	*/
+/*	$NetBSD: npf_show.c,v 1.6 2013/11/19 17:01:45 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: npf_show.c,v 1.5 2013/11/19 00:28:41 rmind Exp $);
+__RCSID($NetBSD: npf_show.c,v 1.6 2013/11/19 17:01:45 christos Exp $);
 
 #include sys/socket.h
 #include netinet/in.h
@@ -161,6 +161,8 @@ print_table(npf_conf_info_t *ctx, const 
 		if (npf_table_getid(tl) == tid)
 			break;
 	}
+	if (tl == NULL)
+		errx(EXIT_FAILURE, table id %u not found, tid);
 	easprintf(p, %s, npf_table_getname(tl));
 	return p;
 }



CVS commit: src/sbin/gpt

2013-11-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Tue Nov 19 19:10:29 UTC 2013

Modified Files:
src/sbin/gpt: add.c

Log Message:
When setting a label on the new partition, be sure to set the label
in the secondary partition table as well.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sbin/gpt/add.c

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

Modified files:

Index: src/sbin/gpt/add.c
diff -u src/sbin/gpt/add.c:1.15 src/sbin/gpt/add.c:1.16
--- src/sbin/gpt/add.c:1.15	Tue Nov 19 05:03:41 2013
+++ src/sbin/gpt/add.c	Tue Nov 19 19:10:29 2013
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: add.c,v 1.15 2013/11/19 05:03:41 jnemeth Exp $);
+__RCSID($NetBSD: add.c,v 1.16 2013/11/19 19:10:29 jnemeth Exp $);
 #endif
 
 #include sys/types.h
@@ -171,6 +171,8 @@ add(int fd)
 	le_uuid_enc(ent-ent_type, type);
 	ent-ent_lba_start = htole64(map-map_start);
 	ent-ent_lba_end = htole64(map-map_start + map-map_size - 1LL);
+	if (name != NULL)
+		utf8_to_utf16(name, ent-ent_name, 36);
 
 	hdr-hdr_crc_table = htole32(crc32(lbt-map_data,
 	le32toh(hdr-hdr_entries) * le32toh(hdr-hdr_entsz)));



CVS commit: src

2013-11-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Tue Nov 19 19:24:34 UTC 2013

Modified Files:
src/distrib/sets/lists/comp: mi
src/lib/libm: Makefile
src/lib/libm/man: sqrt.3
src/lib/libm/src: k_standard.c math_private.h namespace.h s_cbrt.c
w_sqrt.c
src/tests/lib/libm: t_cbrt.c t_sqrt.c
Added Files:
src/lib/libm/src: e_sqrtl.c s_cbrtl.c w_sqrtl.c

Log Message:
Add cbrtl(3) and sqrtl(3), from FreeBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.1861 -r1.1862 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.149 -r1.150 src/lib/libm/Makefile
cvs rdiff -u -r1.13 -r1.14 src/lib/libm/man/sqrt.3
cvs rdiff -u -r0 -r1.1 src/lib/libm/src/e_sqrtl.c src/lib/libm/src/s_cbrtl.c \
src/lib/libm/src/w_sqrtl.c
cvs rdiff -u -r1.18 -r1.19 src/lib/libm/src/k_standard.c
cvs rdiff -u -r1.19 -r1.20 src/lib/libm/src/math_private.h
cvs rdiff -u -r1.9 -r1.10 src/lib/libm/src/namespace.h \
src/lib/libm/src/w_sqrt.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libm/src/s_cbrt.c
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libm/t_cbrt.c
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libm/t_sqrt.c

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1861 src/distrib/sets/lists/comp/mi:1.1862
--- src/distrib/sets/lists/comp/mi:1.1861	Sat Nov 16 13:01:38 2013
+++ src/distrib/sets/lists/comp/mi	Tue Nov 19 19:24:34 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1861 2013/11/16 13:01:38 alnsn Exp $
+#	$NetBSD: mi,v 1.1862 2013/11/19 19:24:34 joerg Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -5666,6 +5666,7 @@
 ./usr/share/man/cat3/cbreak.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cbrt.0			comp-c-catman		.cat
 ./usr/share/man/cat3/cbrtf.0			comp-c-catman		.cat
+./usr/share/man/cat3/cbrtl.0			comp-c-catman		.cat
 ./usr/share/man/cat3/ccos.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/ccosf.0			comp-c-catman		complex,.cat
 ./usr/share/man/cat3/ccosh.0			comp-c-catman		complex,.cat
@@ -8804,6 +8805,7 @@
 ./usr/share/man/cat3/sprintf.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sqrt.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sqrtf.0			comp-c-catman		.cat
+./usr/share/man/cat3/sqrtl.0			comp-c-catman		.cat
 ./usr/share/man/cat3/sradixsort.0		comp-c-catman		.cat
 ./usr/share/man/cat3/srand.0			comp-c-catman		.cat
 ./usr/share/man/cat3/srand48.0			comp-c-catman		.cat
@@ -12269,6 +12271,7 @@
 ./usr/share/man/html3/cbreak.html		comp-c-htmlman		html
 ./usr/share/man/html3/cbrt.html			comp-c-htmlman		html
 ./usr/share/man/html3/cbrtf.html		comp-c-htmlman		html
+./usr/share/man/html3/cbrtl.html		comp-c-htmlman		html
 ./usr/share/man/html3/ccos.html			comp-c-htmlman		complex,html
 ./usr/share/man/html3/ccosf.html		comp-c-htmlman		complex,html
 ./usr/share/man/html3/ccosh.html		comp-c-htmlman		complex,html
@@ -15299,6 +15302,7 @@
 ./usr/share/man/html3/sprintf.html		comp-c-htmlman		html
 ./usr/share/man/html3/sqrt.html			comp-c-htmlman		html
 ./usr/share/man/html3/sqrtf.html		comp-c-htmlman		html
+./usr/share/man/html3/sqrtl.html		comp-c-htmlman		html
 ./usr/share/man/html3/sradixsort.html		comp-c-htmlman		html
 ./usr/share/man/html3/srand.html		comp-c-htmlman		html
 ./usr/share/man/html3/srand48.html		comp-c-htmlman		html
@@ -18696,6 +18700,7 @@
 ./usr/share/man/man3/cbreak.3			comp-c-man		.man
 ./usr/share/man/man3/cbrt.3			comp-c-man		.man
 ./usr/share/man/man3/cbrtf.3			comp-c-man		.man
+./usr/share/man/man3/cbrtl.3			comp-c-man		.man
 ./usr/share/man/man3/ccos.3			comp-c-man		complex,.man
 ./usr/share/man/man3/ccosf.3			comp-c-man		complex,.man
 ./usr/share/man/man3/ccosh.3			comp-c-man		complex,.man
@@ -21830,6 +21835,7 @@
 ./usr/share/man/man3/sprintf.3			comp-c-man		.man
 ./usr/share/man/man3/sqrt.3			comp-c-man		.man
 ./usr/share/man/man3/sqrtf.3			comp-c-man		.man
+./usr/share/man/man3/sqrtl.3			comp-c-man		.man
 ./usr/share/man/man3/sradixsort.3		comp-c-man		.man
 ./usr/share/man/man3/srand.3			comp-c-man		.man
 ./usr/share/man/man3/srand48.3			comp-c-man		.man

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.149 src/lib/libm/Makefile:1.150
--- src/lib/libm/Makefile:1.149	Wed Nov 13 22:09:55 2013
+++ src/lib/libm/Makefile	Tue Nov 19 19:24:33 2013
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.149 2013/11/13 22:09:55 joerg Exp $
+#  $NetBSD: Makefile,v 1.150 2013/11/19 19:24:33 joerg Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -156,11 +156,11 @@ COMMON_SRCS+= b_exp.c b_log.c b_tgamma.c
 	e_j1.c e_j1f.c e_jn.c e_jnf.c e_lgamma_r.c e_lgammaf_r.c e_log.c \
 	e_log2.c e_log10.c e_log10f.c e_log2f.c e_logf.c e_pow.c e_powf.c \
 	e_rem_pio2.c e_rem_pio2f.c e_remainder.c e_remainderf.c e_scalb.c \
-	e_scalbf.c e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c \
+	e_scalbf.c e_sinh.c e_sinhf.c e_sqrt.c e_sqrtf.c e_sqrtl.c \
 	k_cos.c k_cosf.c k_rem_pio2.c k_rem_pio2f.c k_sin.c k_sinf.c 

CVS commit: src/sbin/gpt

2013-11-19 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Tue Nov 19 22:41:43 UTC 2013

Modified Files:
src/sbin/gpt: add.c

Log Message:
delete an errant where it is obvious what the code is doing


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sbin/gpt/add.c

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

Modified files:

Index: src/sbin/gpt/add.c
diff -u src/sbin/gpt/add.c:1.16 src/sbin/gpt/add.c:1.17
--- src/sbin/gpt/add.c:1.16	Tue Nov 19 19:10:29 2013
+++ src/sbin/gpt/add.c	Tue Nov 19 22:41:43 2013
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: add.c,v 1.16 2013/11/19 19:10:29 jnemeth Exp $);
+__RCSID($NetBSD: add.c,v 1.17 2013/11/19 22:41:43 jnemeth Exp $);
 #endif
 
 #include sys/types.h
@@ -200,7 +200,6 @@ cmd_add(int argc, char *argv[])
 	int ch, fd;
 	int64_t human_num;
 
-	/* Get the migrate options */
 	while ((ch = getopt(argc, argv, a:b:i:l:s:t:)) != -1) {
 		switch(ch) {
 		case 'a':



CVS commit: src/libexec/ld.elf_so

2013-11-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Nov 20 07:18:23 UTC 2013

Modified Files:
src/libexec/ld.elf_so: load.c rtld.c

Log Message:
If dlopen of the dynamic linker is requested, e.g. by rump in
rumpuser_dl_bootstrap, then return _rtld_objself as the handle and do
not create a duplicate mapping.

The handle is mostly useless as _rtld_objself doesn't appear on
_rtld_objlist.

This fixes a problem on earm platforms where ld.elf_so (currently) has
an init_array section.  Calling this caused binaries to segv.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/libexec/ld.elf_so/load.c
cvs rdiff -u -r1.170 -r1.171 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/load.c
diff -u src/libexec/ld.elf_so/load.c:1.45 src/libexec/ld.elf_so/load.c:1.46
--- src/libexec/ld.elf_so/load.c:1.45	Thu May  9 15:37:58 2013
+++ src/libexec/ld.elf_so/load.c	Wed Nov 20 07:18:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: load.c,v 1.45 2013/05/09 15:37:58 christos Exp $	 */
+/*	$NetBSD: load.c,v 1.46 2013/11/20 07:18:23 skrll Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: load.c,v 1.45 2013/05/09 15:37:58 christos Exp $);
+__RCSID($NetBSD: load.c,v 1.46 2013/11/20 07:18:23 skrll Exp $);
 #endif /* not lint */
 
 #include err.h
@@ -146,6 +146,13 @@ _rtld_load_object(const char *filepath, 
 		}
 	}
 
+#ifdef RTLD_LOADER
+	if (pathlen == _rtld_objself.pathlen 
+	strcmp(_rtld_objself.path, filepath) == 0) {
+		return _rtld_objself;
+	}
+#endif
+
 	if (obj == NULL) { /* First use of this object, so we must map it in */
 		obj = _rtld_map_object(filepath, fd, sb);
 		(void)close(fd);

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.170 src/libexec/ld.elf_so/rtld.c:1.171
--- src/libexec/ld.elf_so/rtld.c:1.170	Sat Oct 19 17:19:30 2013
+++ src/libexec/ld.elf_so/rtld.c	Wed Nov 20 07:18:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.170 2013/10/19 17:19:30 christos Exp $	 */
+/*	$NetBSD: rtld.c,v 1.171 2013/11/20 07:18:23 skrll Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.170 2013/10/19 17:19:30 christos Exp $);
+__RCSID($NetBSD: rtld.c,v 1.171 2013/11/20 07:18:23 skrll Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -636,8 +636,10 @@ _rtld(Elf_Addr *sp, Elf_Addr relocbase)
 	 * one is being used.
 	 */
 	if (_rtld_objmain-interp != NULL 
-	strcmp(_rtld_objmain-interp, _rtld_objself.path) != 0)
+	strcmp(_rtld_objmain-interp, _rtld_objself.path) != 0) {
 		_rtld_objself.path = xstrdup(_rtld_objmain-interp);
+		_rtld_objself.pathlen = strlen(_rtld_objself.path);
+	}
 	dbg((actual dynamic linker is %s, _rtld_objself.path));
 
 	_rtld_digest_dynamic(execname, _rtld_objmain);