Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch PR 51200 gets in libsa considered harmful: use kgets
details: https://anonhg.NetBSD.org/src/rev/81c058eaf92f
branches: trunk
changeset: 345854:81c058eaf92f
user: dholland <dholland%NetBSD.org@localhost>
date: Sat Jun 11 06:38:50 2016 +0000
description:
PR 51200 gets in libsa considered harmful: use kgets
diffstat:
sys/arch/prep/stand/boot/monitor.c | 4 ++--
sys/arch/rs6000/stand/boot/monitor.c | 4 ++--
sys/arch/sandpoint/stand/altboot/main.c | 8 ++++----
sys/arch/sbmips/stand/common/boot.c | 4 ++--
sys/arch/shark/stand/ofwboot/boot.c | 4 ++--
sys/arch/sparc/stand/boot/boot.c | 6 +++---
sys/arch/sparc/stand/ofwboot/boot.c | 4 ++--
sys/arch/vax/boot/boot/boot.c | 4 ++--
8 files changed, 19 insertions(+), 19 deletions(-)
diffs (170 lines):
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/prep/stand/boot/monitor.c
--- a/sys/arch/prep/stand/boot/monitor.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/prep/stand/boot/monitor.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: monitor.c,v 1.8 2010/02/03 13:47:57 wiz Exp $ */
+/* $NetBSD: monitor.c,v 1.9 2016/06/11 06:38:50 dholland Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
while(1) {
printf("db> ");
- gets(line);
+ kgets(line, sizeof(line));
flag = 0;
for(p = line, argc = 0; *p != '\0'; p++) {
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/rs6000/stand/boot/monitor.c
--- a/sys/arch/rs6000/stand/boot/monitor.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/rs6000/stand/boot/monitor.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: monitor.c,v 1.3 2010/02/03 13:48:17 wiz Exp $ */
+/* $NetBSD: monitor.c,v 1.4 2016/06/11 06:39:25 dholland Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
while(1) {
printf("db> ");
- gets(line);
+ kgets(line, sizeof(line));
flag = 0;
for(p = line, argc = 0; *p != '\0'; p++) {
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/sandpoint/stand/altboot/main.c
--- a/sys/arch/sandpoint/stand/altboot/main.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/sandpoint/stand/altboot/main.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.27 2015/09/30 14:14:32 phx Exp $ */
+/* $NetBSD: main.c,v 1.28 2016/06/11 06:40:24 dholland Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -643,7 +643,7 @@
printf("\nbootargs> ");
cmdline = alloc(256);
- gets(cmdline);
+ kgets(cmdline, 256);
return parse_cmdline(argv, maxargc, cmdline,
cmdline + strlen(cmdline));
@@ -686,7 +686,7 @@
for (;;) {
printf("\nfind> ");
- gets(buf);
+ kgets(buf, sizeof(buf));
if (tolower((unsigned)buf[0]) == 'x')
break;
for (i = 0, n = 0, c = 0; buf[i]; i++) {
@@ -744,7 +744,7 @@
}
printf("controller> ");
- gets(buf);
+ kgets(buf, sizeof(buf));
if (buf[0] == '*' && buf[1] == 'X')
break;
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/sbmips/stand/common/boot.c
--- a/sys/arch/sbmips/stand/common/boot.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/sbmips/stand/common/boot.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.6 2011/01/22 19:19:22 joerg Exp $ */
+/* $NetBSD: boot.c,v 1.7 2016/06/11 06:41:12 dholland Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -119,7 +119,7 @@
if (strchr(boot_flags, 'i') || strchr(boot_flags, 'I')) {
printf("Boot file: ");
- gets(boot_file);
+ kgets(boot_file, sizeof(boot_file));
}
memset(marks, 0, sizeof marks);
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/shark/stand/ofwboot/boot.c
--- a/sys/arch/shark/stand/ofwboot/boot.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/shark/stand/ofwboot/boot.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,5 +1,5 @@
#define DEBUG
-/* $NetBSD: boot.c,v 1.7 2011/01/22 19:19:23 joerg Exp $ */
+/* $NetBSD: boot.c,v 1.8 2016/06/11 06:41:55 dholland Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -232,7 +232,7 @@
if (boothowto & RB_ASKNAME) {
printf("Boot: ");
- gets(bootline);
+ kgets(bootline, sizeof(bootline));
parseargs(bootline, &boothowto);
}
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/sparc/stand/boot/boot.c
--- a/sys/arch/sparc/stand/boot/boot.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/sparc/stand/boot/boot.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.29 2015/11/27 16:52:32 joerg Exp $ */
+/* $NetBSD: boot.c,v 1.30 2016/06/11 06:43:16 dholland Exp $ */
/*-
* Copyright (c) 1982, 1986, 1990, 1993
@@ -285,13 +285,13 @@
if (boothowto & RB_ASKNAME) {
printf("device[%s] (\"halt\" to halt): ",
prom_bootdevice);
- gets(dbuf);
+ kgets(dbuf, sizeof(dbuf));
if (strcmp(dbuf, "halt") == 0)
_rtt();
if (dbuf[0])
strcpy(prom_bootdevice, dbuf);
printf("boot (press RETURN to try default list): ");
- gets(fbuf);
+ kgets(fbuf, sizeof(fbuf));
if (fbuf[0])
strcpy(kernel, fbuf);
else {
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/sparc/stand/ofwboot/boot.c
--- a/sys/arch/sparc/stand/ofwboot/boot.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/sparc/stand/ofwboot/boot.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.32 2016/05/30 10:37:14 martin Exp $ */
+/* $NetBSD: boot.c,v 1.33 2016/06/11 06:43:47 dholland Exp $ */
/*
* Copyright (c) 1997, 1999 Eduardo E. Horvath. All rights reserved.
@@ -463,7 +463,7 @@
char cmdline[PROM_MAX_PATH];
printf("Boot: ");
- gets(cmdline);
+ kgets(cmdline, sizeof(cmdline));
if (!strcmp(cmdline,"exit") ||
!strcmp(cmdline,"halt")) {
diff -r 7aa245bf7db7 -r 81c058eaf92f sys/arch/vax/boot/boot/boot.c
--- a/sys/arch/vax/boot/boot/boot.c Sat Jun 11 06:38:18 2016 +0000
+++ b/sys/arch/vax/boot/boot/boot.c Sat Jun 11 06:38:50 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.33 2015/06/05 16:01:55 martin Exp $ */
+/* $NetBSD: boot.c,v 1.34 2016/06/11 06:42:27 dholland Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@@ -163,7 +163,7 @@
char *c, *d;
printf("> ");
- gets(line);
+ kgets(line, sizeof(line));
c = line;
while (*c == ' ')
Home |
Main Index |
Thread Index |
Old Index