]> git.pld-linux.org Git - packages/expect.git/blame - expect-5.45-exp-log-buf-overflow.patch
- updated to 5.45.4
[packages/expect.git] / expect-5.45-exp-log-buf-overflow.patch
CommitLineData
dade3e15
AM
1diff -up expect5.45/exp_log.c.orig expect5.45/exp_log.c
2--- expect5.45/exp_log.c.orig 2013-12-12 12:43:38.527854189 +0100
3+++ expect5.45/exp_log.c 2013-12-12 12:49:26.866576387 +0100
4@@ -176,7 +176,7 @@ expStdoutLog TCL_VARARGS_DEF(int,arg1)
5
6 if ((!tsdPtr->logUser) && (!force_stdout) && (!tsdPtr->logAll)) return;
7
8- (void) vsprintf(bigbuf,fmt,args);
9+ (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
10 expDiagWriteBytes(bigbuf,-1);
11 if (tsdPtr->logAll || (LOGUSER && tsdPtr->logChannel)) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1);
12 if (LOGUSER) fprintf(stdout,"%s",bigbuf);
13@@ -222,7 +222,7 @@ expErrorLog TCL_VARARGS_DEF(char *,arg1)
14 va_list args;
15
16 fmt = TCL_VARARGS_START(char *,arg1,args);
17- (void) vsprintf(bigbuf,fmt,args);
18+ (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
19
20 expDiagWriteChars(bigbuf,-1);
21 fprintf(stderr,"%s",bigbuf);
22@@ -264,7 +264,7 @@ expDiagLog TCL_VARARGS_DEF(char *,arg1)
23
24 fmt = TCL_VARARGS_START(char *,arg1,args);
25
26- (void) vsprintf(bigbuf,fmt,args);
27+ (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
28
29 expDiagWriteBytes(bigbuf,-1);
30 if (tsdPtr->diagToStderr) {
31@@ -307,7 +307,7 @@ expPrintf TCL_VARARGS_DEF(char *,arg1)
32 int len, rc;
33
34 fmt = TCL_VARARGS_START(char *,arg1,args);
35- len = vsprintf(bigbuf,arg1,args);
36+ len = vsnprintf(bigbuf,sizeof(bigbuf),arg1,args);
37 retry:
38 rc = write(2,bigbuf,len);
39 if ((rc == -1) && (errno == EAGAIN)) goto retry;
This page took 0.071063 seconds and 4 git commands to generate.