aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/getnetgrent.c
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1996-12-27 19:28:46 +0000
committerBill Paul <wpaul@FreeBSD.org>1996-12-27 19:28:46 +0000
commit1d2493ff77f8fcc1c7197e4fb0124db17ecf8ea3 (patch)
treeb3899e41109595c94a952b728bb8f15ac2b7d3c4 /lib/libc/gen/getnetgrent.c
parent33c9a3df24c6dfea95c009d27a23e7629a7c9c6a (diff)
downloadsrc-1d2493ff77f8fcc1c7197e4fb0124db17ecf8ea3.tar.gz
src-1d2493ff77f8fcc1c7197e4fb0124db17ecf8ea3.zip
Small yet significant tweaks/cleanups:
- getpwent: o adjunctbuf should be NUL terminated after copying o _pw_breakout_yp() needs to know the length of the buffer returned from YP so it can properly NUL terminate its local buffer. - getgrent: o YP buffers should be YPMAXRECORD + 2 bytes long and NUL terminated. (Previously they were hardcoded to 1024 bytes.) - getnetgrent: o YP data should be copied with snprintf(), not sprintf() These are 2.2 candidates. I will wait a few days to make sure these don't break anything and then, if there are no objections, move them to the 2.2 branch.
Notes
Notes: svn path=/head/; revision=20957
Diffstat (limited to 'lib/libc/gen/getnetgrent.c')
-rw-r--r--lib/libc/gen/getnetgrent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index f0d7967f1417..46cc76462c92 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -503,7 +503,7 @@ read_for_group(group)
register int len, olen;
int cont;
struct linelist *lp;
- char line[LINSIZ + 1];
+ char line[LINSIZ + 2];
#ifdef YP
char *result;
int resultlen;
@@ -523,7 +523,7 @@ read_for_group(group)
continue;
}
}
- sprintf(line, "%s %s", group, result);
+ snprintf(line, LINSIZ, "%s %s", group, result);
free(result);
}
#else