From 897cad3662024798463bc418bddaac801228da76 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 23 Sep 1996 05:56:18 +0000 Subject: Better protection against buffer overruns. svn path=/trunk/; revision=106 --- pop2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pop2.c') diff --git a/pop2.c b/pop2.c index 26bc1ea9..5b27e918 100644 --- a/pop2.c +++ b/pop2.c @@ -311,7 +311,7 @@ int socket; int POP2_stateGREET (socket) int socket; { - char buf [POPBUFSIZE]; + char buf [POPBUFSIZE+1]; /* read the greeting from the server */ if (SockGets(socket, buf, sizeof(buf)) >= 0) { @@ -356,7 +356,7 @@ int POP2_stateNMBR (socket) int socket; { int number; - char buf [POPBUFSIZE]; + char buf [POPBUFSIZE+1]; /* read the NMBR (#ccc) message from the server */ if (SockGets(socket, buf, sizeof(buf)) >= 0) { @@ -405,7 +405,7 @@ int POP2_stateSIZE (socket) int socket; { int msgsize; - char buf [POPBUFSIZE]; + char buf [POPBUFSIZE+1]; /* read the SIZE message (=ccc) from the server */ if (SockGets(socket, buf, sizeof(buf)) >= 0) @@ -463,8 +463,8 @@ int mboxfd; int topipe; { int i,buflen,actsize; - char buf [MSGBUFSIZE]; - char frombuf [MSGBUFSIZE]; + char buf [MSGBUFSIZE+1]; + char frombuf [MSGBUFSIZE+1]; char savec; int msgTop; int needFrom; -- cgit v1.2.3