libc: stream adds length check
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
1c9c6e94f0
commit
ca290e85ea
|
@ -200,6 +200,11 @@ static int syslogstream_puts(FAR struct lib_outstream_s *this,
|
|||
int ret = 0;
|
||||
|
||||
DEBUGASSERT(stream != NULL);
|
||||
if (len <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
stream->last_ch = ((FAR const char *)buff)[len -1];
|
||||
|
||||
#ifdef CONFIG_SYSLOG_BUFFER
|
||||
|
|
Loading…
Reference in New Issue