aboutsummaryrefslogtreecommitdiffstats
path: root/src/ppp-watch.c
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-03-08 23:31:46 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-03-08 23:31:46 +0000
commit4fbc05eec7759e40cbb95be766e281a2bfbd1f7f (patch)
tree9c1464a6919ccaadb4af70b5652ce380de19ff31 /src/ppp-watch.c
parent2731ef1aa69fd8e20713079698569a078f24ca43 (diff)
downloadinitscripts-4fbc05eec7759e40cbb95be766e281a2bfbd1f7f.tar
initscripts-4fbc05eec7759e40cbb95be766e281a2bfbd1f7f.tar.gz
initscripts-4fbc05eec7759e40cbb95be766e281a2bfbd1f7f.tar.bz2
initscripts-4fbc05eec7759e40cbb95be766e281a2bfbd1f7f.tar.xz
initscripts-4fbc05eec7759e40cbb95be766e281a2bfbd1f7f.zip
- Fix one-byte buffer overflow
- Make theChild a pid_t
Diffstat (limited to 'src/ppp-watch.c')
-rw-r--r--src/ppp-watch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ppp-watch.c b/src/ppp-watch.c
index 9cb63d78..d178d062 100644
--- a/src/ppp-watch.c
+++ b/src/ppp-watch.c
@@ -92,7 +92,7 @@ static int pipeArray[2];
// patch to respect the maxfail parameter to ppp
// Scott Sharkey <ssharkey@linux-no-limits.com>
static int dialCount = 0;
-static int theChild;
+static pid_t theChild;
static void failureExit(int exitCode);
static void
@@ -380,7 +380,7 @@ pppLogicalToPhysical(int *pppdPid, char *logicalName, char **physicalName) {
logicalName);
fd = open(mapFileName, O_RDONLY);
if (fd != -1) {
- n = read(fd, buffer, sizeof(buffer));
+ n = read(fd, buffer, sizeof(buffer) - 1);
close(fd);
if (n > 0) {
buffer[n] = '\0';