[srvx-commits] CVS: services/src proto.c,1.68.2.9,1.68.2.10
Brought to you by:
entrope
From: Adrian D. <sai...@us...> - 2001-08-22 04:21:37
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv14876 Modified Files: Tag: rel-1_0 proto.c Log Message: Prevent buffer overflow Index: proto.c =================================================================== RCS file: /cvsroot/srvx/services/src/Attic/proto.c,v retrieving revision 1.68.2.9 retrieving revision 1.68.2.10 diff -C2 -r1.68.2.9 -r1.68.2.10 *** proto.c 2001/08/16 02:39:18 1.68.2.9 --- proto.c 2001/08/22 04:21:34 1.68.2.10 *************** *** 278,282 **** va_start(arg_list, text); pos = vsnprintf(buffer, MAXLEN - 2, text, arg_list); ! if (pos < 0) pos = MAXLEN - 2; /* buffer[pos++] = '\r'; */ buffer[pos++] = '\n'; --- 278,282 ---- va_start(arg_list, text); pos = vsnprintf(buffer, MAXLEN - 2, text, arg_list); ! if (pos < 0 || pos > (MAXLEN - 2)) pos = MAXLEN - 2; /* buffer[pos++] = '\r'; */ buffer[pos++] = '\n'; |