From 3d0e0612761be48a2c7aee0c256fb49735aed26a Mon Sep 17 00:00:00 2001 From: JeonginKim Date: Thu, 12 Oct 2017 10:53:46 +0900 Subject: [PATCH] Memory corruption security issue fixed for FTP client --- external/ftpc/ftpc_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/ftpc/ftpc_utils.c b/external/ftpc/ftpc_utils.c index c87d8c3..e519d0d 100644 --- a/external/ftpc/ftpc_utils.c +++ b/external/ftpc/ftpc_utils.c @@ -173,7 +173,7 @@ void ftpc_stripcrlf(FAR char *str) len = strlen(str); if (len > 0) { ptr = str + len - 1; - while (*ptr == '\r' || *ptr == '\n') { + while ((ptr >= str) && (*ptr == '\r' || *ptr == '\n')) { *ptr = '\0'; ptr--; } -- 2.7.4