You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/23 06:28:59 UTC

[incubator-nuttx-apps] 04/07: Revert "nshlib: fix possible out of bounds array access"

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch revert-1377-minor_fixes
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit 0b643ada59ba5e2f5a8ceda732c77435637af974
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Sun Oct 23 09:28:49 2022 +0300

    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