dtlogin: Coverity (memory corruption, moderate)

This commit is contained in:
Jon Trulson
2014-12-26 16:23:54 -07:00
parent 00540cb375
commit 235a75c03c
5 changed files with 22 additions and 19 deletions

View File

@@ -236,7 +236,8 @@ TrimErrorFile( void )
return;
}
n = read(f2, buf, BUFSIZ);
memset(buf, 0, BUFSIZ);
n = read(f2, buf, BUFSIZ - 1);
if ( (p = strchr(buf,'\n')) != NULL ) {
p++;