PR 51200 gets in libsa considered harmful: use kgets

This commit is contained in:
dholland 2016-06-11 06:38:50 +00:00
parent 144178bb59
commit 2357cddab4
8 changed files with 19 additions and 19 deletions

View File

@ -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 @@ db_monitor(void)
while(1) {
printf("db> ");
gets(line);
kgets(line, sizeof(line));
flag = 0;
for(p = line, argc = 0; *p != '\0'; p++) {

View File

@ -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 @@ db_monitor(void)
while(1) {
printf("db> ");
gets(line);
kgets(line, sizeof(line));
flag = 0;
for(p = line, argc = 0; *p != '\0'; p++) {

View File

@ -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 @@ static int input_cmdline(char **argv, int maxargc)
printf("\nbootargs> ");
cmdline = alloc(256);
gets(cmdline);
kgets(cmdline, 256);
return parse_cmdline(argv, maxargc, cmdline,
cmdline + strlen(cmdline));
@ -686,7 +686,7 @@ findflash(void)
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 @@ sat_test(void)
}
printf("controller> ");
gets(buf);
kgets(buf, sizeof(buf));
if (buf[0] == '*' && buf[1] == 'X')
break;

View File

@ -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 @@ main(long fwhandle,long fd,long fwentry)
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);

View File

@ -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 @@ main(void)
if (boothowto & RB_ASKNAME) {
printf("Boot: ");
gets(bootline);
kgets(bootline, sizeof(bootline));
parseargs(bootline, &boothowto);
}

View File

@ -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 @@ main(void)
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 {

View File

@ -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 @@ main(void *ofw)
char cmdline[PROM_MAX_PATH];
printf("Boot: ");
gets(cmdline);
kgets(cmdline, sizeof(cmdline));
if (!strcmp(cmdline,"exit") ||
!strcmp(cmdline,"halt")) {

View File

@ -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 @@ Xmain(void)
char *c, *d;
printf("> ");
gets(line);
kgets(line, sizeof(line));
c = line;
while (*c == ' ')