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/bb8e94e3fbb1
branches:  trunk
changeset: 345851:bb8e94e3fbb1
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Jun 11 06:24:36 2016 +0000

description:
PR 51200 gets in libsa considered harmful: use kgets

diffstat:

 sys/arch/acorn26/stand/boot26/boot26.c |  4 ++--
 sys/arch/acorn32/stand/boot32/boot32.c |  4 ++--
 sys/arch/alpha/stand/common/boot.c     |  4 ++--
 sys/arch/alpha/stand/standtest/test.c  |  4 ++--
 sys/arch/atari/stand/bootxx/bootxx.c   |  6 +++---
 sys/arch/bebox/stand/boot/monitor.c    |  4 ++--
 sys/arch/hpcmips/stand/lcboot/main.c   |  6 +++---
 sys/arch/landisk/stand/boot/boot2.c    |  4 ++--
 sys/arch/landisk/stand/boot/monitor.c  |  4 ++--
 sys/arch/macppc/stand/ofwboot/boot.c   |  4 ++--
 sys/arch/mvme68k/stand/netboot/boot.c  |  4 ++--
 sys/arch/mvmeppc/stand/boot/boot.c     |  4 ++--
 12 files changed, 26 insertions(+), 26 deletions(-)

diffs (234 lines):

diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/acorn26/stand/boot26/boot26.c
--- a/sys/arch/acorn26/stand/boot26/boot26.c    Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/acorn26/stand/boot26/boot26.c    Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot26.c,v 1.6 2011/01/22 19:19:14 joerg Exp $ */
+/*     $NetBSD: boot26.c,v 1.7 2016/06/11 06:24:36 dholland Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 Ben Harris
@@ -99,7 +99,7 @@
        if (file == NULL) {
                if (howto & RB_ASKNAME) {
                        printf("boot: ");
-                       gets(fbuf);
+                       kgets(fbuf, sizeof(fbuf));
                        file = fbuf;
                } else
                        file = "netbsd";
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/acorn32/stand/boot32/boot32.c
--- a/sys/arch/acorn32/stand/boot32/boot32.c    Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/acorn32/stand/boot32/boot32.c    Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot32.c,v 1.41 2014/03/21 16:43:00 christos Exp $     */
+/*     $NetBSD: boot32.c,v 1.42 2016/06/11 06:25:21 dholland Exp $     */
 
 /*-
  * Copyright (c) 2002 Reinoud Zandijk
@@ -1038,7 +1038,7 @@
        if (*file == NULL) {
                if (*howto & RB_ASKNAME) {
                        printf("boot: ");
-                       gets(filename);
+                       kgets(filename, sizeof(filename));
                        strcpy(file, filename);
                } else
                        strcpy(file, "netbsd");
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/alpha/stand/common/boot.c
--- a/sys/arch/alpha/stand/common/boot.c        Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/alpha/stand/common/boot.c        Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.32 2011/01/22 19:19:15 joerg Exp $ */
+/* $NetBSD: boot.c,v 1.33 2016/06/11 06:26:06 dholland Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -118,7 +118,7 @@
 
        if (strchr(boot_flags, 'i') || strchr(boot_flags, 'I')) {
                printf("Boot file: ");
-               gets(boot_file);
+               kgets(boot_file, sizeof(boot_file));
        }
 
 #ifdef NO_LOAD_BACKWARDS
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/alpha/stand/standtest/test.c
--- a/sys/arch/alpha/stand/standtest/test.c     Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/alpha/stand/standtest/test.c     Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: test.c,v 1.6 2015/12/13 18:51:14 christos Exp $ */
+/* $NetBSD: test.c,v 1.7 2016/06/11 06:26:50 dholland Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -115,7 +115,7 @@
 
        do {
                printf("test> ");
-               gets(input_buf);
+               kgets(input_buf, sizeof(input_buf));
 
                dispatch_cmd(input_buf, toplevel_cmds);
        } while (!done);
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/atari/stand/bootxx/bootxx.c
--- a/sys/arch/atari/stand/bootxx/bootxx.c      Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/atari/stand/bootxx/bootxx.c      Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootxx.c,v 1.16 2014/11/15 06:30:10 tsutsui Exp $      */
+/*     $NetBSD: bootxx.c,v 1.17 2016/06/11 06:28:07 dholland Exp $     */
 
 /*
  * Copyright (c) 1995 Waldi Ravens.
@@ -66,7 +66,7 @@
        setheap((void *)HEAPSTART, (void *)HEAPEND);
 
        printf("\033v\nNetBSD/atari secondary bootloader"
-                                               " ($Revision: 1.16 $)\n\n");
+                                               " ($Revision: 1.17 $)\n\n");
 
        if (init_dskio(readsector, disklabel, -1))
                return -1;
@@ -109,7 +109,7 @@
 
        printf("\nEnter os-type [.%s] root-fs [:a] kernel [%s]"
               " options [none]:\n\033e", od->ostype, od->osname);
-       gets(p);
+       kgets(p, sizeof(line));
        printf("\033f");
 
        for (;;) {
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/bebox/stand/boot/monitor.c
--- a/sys/arch/bebox/stand/boot/monitor.c       Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/bebox/stand/boot/monitor.c       Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: monitor.c,v 1.10 2014/06/01 17:21:50 phx Exp $ */
+/*     $NetBSD: monitor.c,v 1.11 2016/06/11 06:28:49 dholland Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
 
        while (1) {
                printf("db> ");
-               gets(line);
+               kgets(line, sizeof(line));
 
                flag = 0;
                for (p = line, argc = 0; *p != '\0'; p++) {
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/hpcmips/stand/lcboot/main.c
--- a/sys/arch/hpcmips/stand/lcboot/main.c      Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/hpcmips/stand/lcboot/main.c      Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.6 2011/01/22 19:19:18 joerg Exp $ */
+/* $NetBSD: main.c,v 1.7 2016/06/11 06:29:24 dholland Exp $ */
 
 /*
  * Copyright (c) 2003 Naoto Shimazaki.
@@ -107,7 +107,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: main.c,v 1.6 2011/01/22 19:19:18 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: main.c,v 1.7 2016/06/11 06:29:24 dholland Exp $");
 
 #include <lib/libsa/stand.h>
 
@@ -833,7 +833,7 @@
                /* input a line */
                input[0] = '\0';
                printf("> ");
-               gets(input);
+               kgets(input, sizeof(input));
                cmd = input;
 
                /* skip leading whitespace. */
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/landisk/stand/boot/boot2.c
--- a/sys/arch/landisk/stand/boot/boot2.c       Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/landisk/stand/boot/boot2.c       Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot2.c,v 1.5 2016/05/31 04:05:50 dholland Exp $       */
+/*     $NetBSD: boot2.c,v 1.6 2016/06/11 06:31:49 dholland Exp $       */
 
 /*
  * Copyright (c) 2003
@@ -410,7 +410,7 @@
 
                input[0] = '\0';
                printf("> ");
-               gets(input);
+               kgets(input, sizeof(input));
 
                /*
                 * Skip leading whitespace.
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/landisk/stand/boot/monitor.c
--- a/sys/arch/landisk/stand/boot/monitor.c     Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/landisk/stand/boot/monitor.c     Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: monitor.c,v 1.3 2009/03/14 15:36:08 dsl Exp $  */
+/*     $NetBSD: monitor.c,v 1.4 2016/06/11 06:31:49 dholland Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
 
        for (;;) {
                printf("db> ");
-               gets(line);
+               kgets(line, sizeof(line));
 
                flag = 0;
                argc = 0;
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/macppc/stand/ofwboot/boot.c
--- a/sys/arch/macppc/stand/ofwboot/boot.c      Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/macppc/stand/ofwboot/boot.c      Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.27 2012/02/19 12:02:55 tsutsui Exp $        */
+/*     $NetBSD: boot.c,v 1.28 2016/06/11 06:32:45 dholland Exp $       */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -269,7 +269,7 @@
 
                if (boothowto & RB_ASKNAME) {
                        printf("Boot: ");
-                       gets(bootline);
+                       kgets(bootline, sizeof(bootline));
                        parseargs(bootline, &boothowto);
                }
 
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/mvme68k/stand/netboot/boot.c
--- a/sys/arch/mvme68k/stand/netboot/boot.c     Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/mvme68k/stand/netboot/boot.c     Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.16 2008/01/12 09:54:32 tsutsui Exp $ */
+/*     $NetBSD: boot.c,v 1.17 2016/06/11 06:33:30 dholland Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -66,7 +66,7 @@
        for (;;) {
                if (ask) {
                        printf("boot: ");
-                       gets(line);
+                       kgets(line, sizeof(line));
                        if (line[0]) {
                                bugargs.arg_start = line;
                                cp = line;
diff -r 33b2cd470242 -r bb8e94e3fbb1 sys/arch/mvmeppc/stand/boot/boot.c
--- a/sys/arch/mvmeppc/stand/boot/boot.c        Sat Jun 11 06:22:11 2016 +0000
+++ b/sys/arch/mvmeppc/stand/boot/boot.c        Sat Jun 11 06:24:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.6 2014/08/06 13:55:08 joerg Exp $   */
+/*     $NetBSD: boot.c,v 1.7 2016/06/11 06:34:00 dholland Exp $        */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@
        for (;;) {
                if (ask) {
                        printf("boot: ");
-                       gets(line);
+                       kgets(line, sizeof(line));
                        if (strcmp(line, "halt") == 0)
                                break;
 



Home | Main Index | Thread Index | Old Index