mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
One line fix to silently ignore entries that start with a '+' or '-'.
This prevents yp_mkdb from adding magic NIS entries to NIS maps themselves.
This commit is contained in:
parent
bbf437ee54
commit
4f93d7d4de
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7538
1 changed files with 2 additions and 1 deletions
|
@ -20,7 +20,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
* $Id: yp_mkdb.c,v 1.1 1995/01/31 08:43:07 wpaul Exp $
|
||||
*/
|
||||
|
||||
#define BUFFERSIZE 4096
|
||||
|
@ -151,6 +151,7 @@ load( char *FileName, char *DbName)
|
|||
|
||||
fgets(Buffer, BUFFERSIZE, infile);
|
||||
if (feof(infile)) break;
|
||||
if (Buffer[0] == '+' || Buffer[0] == '-') break;
|
||||
r=strlen(Buffer)-1;
|
||||
if (Buffer[r]!='\n' && r>=BUFFERSIZE) {
|
||||
fprintf(stderr, "%s: Buffer overflow\n", FileName);
|
||||
|
|
Loading…
Reference in a new issue