Merge pull request #24630 from taosdata/fix/xsren/printSlowLogStackOverflow3.0
fix: printSlowLog heap over flow
This commit is contained in:
commit
d4a2553ace
|
@ -573,6 +573,9 @@ void taosPrintSlowLog(const char *format, ...) {
|
|||
len += vsnprintf(buffer + len, LOG_MAX_LINE_DUMP_BUFFER_SIZE - 2 - len, format, argpointer);
|
||||
va_end(argpointer);
|
||||
|
||||
if (len < 0 || len > LOG_MAX_LINE_DUMP_BUFFER_SIZE - 2) {
|
||||
len = LOG_MAX_LINE_DUMP_BUFFER_SIZE - 2;
|
||||
}
|
||||
buffer[len++] = '\n';
|
||||
buffer[len] = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue