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