Module Name: src
Committed By: mrg
Date: Mon Feb 4 04:36:41 UTC 2019
Modified Files:
src/bin/pax: ar_io.c
src/crypto/external/bsd/openssh/dist: fmt_scaled.h scp.c
src/libexec/telnetd: utility.c
src/sbin/bioctl: bioctl.c
Log Message:
- bump buffer sizes to avoid potential truncation issues
To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/bin/pax/ar_io.c
cvs rdiff -u -r1.7 -r1.8 src/crypto/external/bsd/openssh/dist/fmt_scaled.h
cvs rdiff -u -r1.21 -r1.22 src/crypto/external/bsd/openssh/dist/scp.c
cvs rdiff -u -r1.32 -r1.33 src/libexec/telnetd/utility.c
cvs rdiff -u -r1.17 -r1.18 src/sbin/bioctl/bioctl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/pax/ar_io.c
diff -u src/bin/pax/ar_io.c:1.58 src/bin/pax/ar_io.c:1.59
--- src/bin/pax/ar_io.c:1.58 Mon Oct 2 21:57:59 2017
+++ src/bin/pax/ar_io.c Mon Feb 4 04:36:41 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ar_io.c,v 1.58 2017/10/02 21:57:59 joerg Exp $ */
+/* $NetBSD: ar_io.c,v 1.59 2019/02/04 04:36:41 mrg Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
#else
-__RCSID("$NetBSD: ar_io.c,v 1.58 2017/10/02 21:57:59 joerg Exp $");
+__RCSID("$NetBSD: ar_io.c,v 1.59 2019/02/04 04:36:41 mrg Exp $");
#endif
#endif /* not lint */
@@ -1631,7 +1631,7 @@ void
ar_summary(int n)
{
time_t secs;
- char buf[BUFSIZ];
+ char buf[4096];
char tbuf[MAXPATHLEN/4]; /* XXX silly size! */
char s1buf[MAXPATHLEN/8]; /* XXX very silly size! */
char s2buf[MAXPATHLEN/8]; /* XXX very silly size! */
Index: src/crypto/external/bsd/openssh/dist/fmt_scaled.h
diff -u src/crypto/external/bsd/openssh/dist/fmt_scaled.h:1.7 src/crypto/external/bsd/openssh/dist/fmt_scaled.h:1.8
--- src/crypto/external/bsd/openssh/dist/fmt_scaled.h:1.7 Tue Apr 18 18:41:46 2017
+++ src/crypto/external/bsd/openssh/dist/fmt_scaled.h Mon Feb 4 04:36:41 2019
@@ -1,6 +1,6 @@
-/* $NetBSD: fmt_scaled.h,v 1.7 2017/04/18 18:41:46 christos Exp $ */
+/* $NetBSD: fmt_scaled.h,v 1.8 2019/02/04 04:36:41 mrg Exp $ */
#ifndef FMT_SCALED_STRSIZE
-#define FMT_SCALED_STRSIZE 7
+#define FMT_SCALED_STRSIZE 40
#endif
int fmt_scaled(long long, char *);
int scan_scaled(const char *, long long *);
Index: src/crypto/external/bsd/openssh/dist/scp.c
diff -u src/crypto/external/bsd/openssh/dist/scp.c:1.21 src/crypto/external/bsd/openssh/dist/scp.c:1.22
--- src/crypto/external/bsd/openssh/dist/scp.c:1.21 Sun Jan 27 02:08:33 2019
+++ src/crypto/external/bsd/openssh/dist/scp.c Mon Feb 4 04:36:41 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: scp.c,v 1.21 2019/01/27 02:08:33 pgoyette Exp $ */
+/* $NetBSD: scp.c,v 1.22 2019/02/04 04:36:41 mrg Exp $ */
/* $OpenBSD: scp.c,v 1.197 2018/06/01 04:31:48 dtucker Exp $ */
/*
@@ -74,7 +74,7 @@
*/
#include "includes.h"
-__RCSID("$NetBSD: scp.c,v 1.21 2019/01/27 02:08:33 pgoyette Exp $");
+__RCSID("$NetBSD: scp.c,v 1.22 2019/02/04 04:36:41 mrg Exp $");
#include <sys/param.h> /* roundup MAX */
#include <sys/types.h>
@@ -911,7 +911,7 @@ rsource(char *name, struct stat *statp)
{
DIR *dirp;
struct dirent *dp;
- char *last, *vect[1], path[PATH_MAX];
+ char *last, *vect[1], path[PATH_MAX + 20];
if (!(dirp = opendir(name))) {
run_err("%s: %s", name, strerror(errno));
Index: src/libexec/telnetd/utility.c
diff -u src/libexec/telnetd/utility.c:1.32 src/libexec/telnetd/utility.c:1.33
--- src/libexec/telnetd/utility.c:1.32 Mon Jan 9 16:36:48 2012
+++ src/libexec/telnetd/utility.c Mon Feb 4 04:36:41 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: utility.c,v 1.32 2012/01/09 16:36:48 christos Exp $ */
+/* $NetBSD: utility.c,v 1.33 2019/02/04 04:36:41 mrg Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
#else
-__RCSID("$NetBSD: utility.c,v 1.32 2012/01/09 16:36:48 christos Exp $");
+__RCSID("$NetBSD: utility.c,v 1.33 2019/02/04 04:36:41 mrg Exp $");
#endif
#endif /* not lint */
@@ -717,7 +717,7 @@ printsub(
break;
}
{
- char tbuf[32];
+ char tbuf[40];
(void)snprintf(tbuf, sizeof tbuf, "%s%s%s%s%s",
pointer[2]&MODE_EDIT ? "|EDIT" : "",
Index: src/sbin/bioctl/bioctl.c
diff -u src/sbin/bioctl/bioctl.c:1.17 src/sbin/bioctl/bioctl.c:1.18
--- src/sbin/bioctl/bioctl.c:1.17 Fri Jan 16 20:12:28 2015
+++ src/sbin/bioctl/bioctl.c Mon Feb 4 04:36:41 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: bioctl.c,v 1.17 2015/01/16 20:12:28 christos Exp $ */
+/* $NetBSD: bioctl.c,v 1.18 2019/02/04 04:36:41 mrg Exp $ */
/* $OpenBSD: bioctl.c,v 1.52 2007/03/20 15:26:06 jmc Exp $ */
/*
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: bioctl.c,v 1.17 2015/01/16 20:12:28 christos Exp $");
+__RCSID("$NetBSD: bioctl.c,v 1.18 2019/02/04 04:36:41 mrg Exp $");
#endif
#include <sys/types.h>
@@ -237,7 +237,7 @@ bio_show_volumes(struct biotmp *bt)
struct bioc_vol bv;
const char *status, *rtypestr, *stripestr;
char size[64], percent[16], seconds[20];
- char rtype[16], stripe[16], tmp[32];
+ char rtype[16], stripe[16], tmp[48];
rtypestr = stripestr = NULL;
@@ -345,7 +345,7 @@ bio_show_disks(struct biotmp *bt)
{
struct bioc_disk bd;
const char *status;
- char size[64], serial[32], scsiname[16];
+ char size[64], serial[32], scsiname[34];
memset(&bd, 0, sizeof(bd));
bd.bd_cookie = bl.bl_cookie;