diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:59:28 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 14:59:28 +0000 |
commit | 54c2e843134660a26a8923517d09519ce884c422 (patch) | |
tree | d338e64c26d86c31821227b5e62daf1144fdd1f1 /expect-5.45-exp-log-buf-overflow.patch | |
parent | 620ca363f3f7629f6b720c849aeb7a66a3e05ea0 (diff) |
automatic import of expectopeneuler24.03_LTSopeneuler23.09
Diffstat (limited to 'expect-5.45-exp-log-buf-overflow.patch')
-rw-r--r-- | expect-5.45-exp-log-buf-overflow.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/expect-5.45-exp-log-buf-overflow.patch b/expect-5.45-exp-log-buf-overflow.patch new file mode 100644 index 0000000..162db80 --- /dev/null +++ b/expect-5.45-exp-log-buf-overflow.patch @@ -0,0 +1,39 @@ +diff -up expect5.45/exp_log.c.orig expect5.45/exp_log.c +--- expect5.45/exp_log.c.orig 2013-12-12 12:43:38.527854189 +0100 ++++ expect5.45/exp_log.c 2013-12-12 12:49:26.866576387 +0100 +@@ -176,7 +176,7 @@ expStdoutLog TCL_VARARGS_DEF(int,arg1) + + if ((!tsdPtr->logUser) && (!force_stdout) && (!tsdPtr->logAll)) return; + +- (void) vsprintf(bigbuf,fmt,args); ++ (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args); + expDiagWriteBytes(bigbuf,-1); + if (tsdPtr->logAll || (LOGUSER && tsdPtr->logChannel)) Tcl_WriteChars(tsdPtr->logChannel,bigbuf,-1); + if (LOGUSER) fprintf(stdout,"%s",bigbuf); +@@ -222,7 +222,7 @@ expErrorLog TCL_VARARGS_DEF(char *,arg1) + va_list args; + + fmt = TCL_VARARGS_START(char *,arg1,args); +- (void) vsprintf(bigbuf,fmt,args); ++ (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args); + + expDiagWriteChars(bigbuf,-1); + fprintf(stderr,"%s",bigbuf); +@@ -264,7 +264,7 @@ expDiagLog TCL_VARARGS_DEF(char *,arg1) + + fmt = TCL_VARARGS_START(char *,arg1,args); + +- (void) vsprintf(bigbuf,fmt,args); ++ (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args); + + expDiagWriteBytes(bigbuf,-1); + if (tsdPtr->diagToStderr) { +@@ -307,7 +307,7 @@ expPrintf TCL_VARARGS_DEF(char *,arg1) + int len, rc; + + fmt = TCL_VARARGS_START(char *,arg1,args); +- len = vsprintf(bigbuf,arg1,args); ++ len = vsnprintf(bigbuf,sizeof(bigbuf),arg1,args); + retry: + rc = write(2,bigbuf,len); + if ((rc == -1) && (errno == EAGAIN)) goto retry; |