mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
libc/execinfo/dumpstack: correct the line size to avoid LF overwrite
Change-Id: I6550df87ffd7da19119dedddc22d093fcf1c623a Signed-off-by: chao.an <anchao@xiaomi.com> (cherry picked from commit 288268e41ea07786c438bb068b840d7c7dbe2d0b)
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
void dump_stack(void)
|
||||
{
|
||||
FAR void *address[DUMP_DEPTH];
|
||||
char line[DUMP_LINESIZE];
|
||||
char line[DUMP_LINESIZE + 1];
|
||||
int ret = 0;
|
||||
int size;
|
||||
int i;
|
||||
@@ -61,7 +61,7 @@ void dump_stack(void)
|
||||
DUMP_FORMAT, DUMP_WIDTH, address[i]);
|
||||
if (i == size - 1 || ret % DUMP_LINESIZE == 0)
|
||||
{
|
||||
syslog(LOG_INFO, "[BackTrace]: %s\n", line);
|
||||
syslog(LOG_INFO, "[CallStack %d]: %s\n", i / DUMP_NITEM, line);
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user