PD#OTT-25875
Problem:
detected buffer overflow in memcpy
Solution:
The parameter checking
Verify:
RDK + S905X4
Change-Id: I7d41111e58a7c4667e0c527890e41766970b840b
Signed-off-by: rui guo <rui.guo@amlogic.com>
if (size == 0)
return 0;
+ /* Line_size Out-of-bounds check */
+ text_size = text_size < (OPTEE_LOG_LINE_MAX - 16) ? text_size : OPTEE_LOG_LINE_MAX - 16;
+
do {
const char *next = memchr(text, '\n', text_size);
size_t line_size;