From fe4b44e3ff27220b4f1abf5d46cdc29dc1afa64d Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Sun, 23 Oct 2022 09:28:49 +0300 Subject: [PATCH] Revert "nshlib: fix possible out of bounds array access" This reverts commit f6a86a578d52783b2662405e1c0f3b16093f3141. --- nshlib/nsh_fsutils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index c9b50710c..2f88549c5 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -513,6 +513,7 @@ FAR char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl, snprintf(vtbl->iobuffer, IOBUFFERSIZE, "%s/%s", dirpath, path); } + vtbl->iobuffer[PATH_MAX] = '\0'; return strdup(vtbl->iobuffer); } #endif