From 4fbc05eec7759e40cbb95be766e281a2bfbd1f7f Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Wed, 8 Mar 2006 23:31:46 +0000 Subject: - Fix one-byte buffer overflow - Make theChild a pid_t --- src/ppp-watch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 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'; -- cgit