You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/10/17 23:31:46 UTC

[GitHub] [incubator-nuttx] masayuki2009 commented on a diff in pull request #7319: fs/procfs: Change FS_PROCFS_EXCLUDE_xxx default value to DEFAULT_SMALL

masayuki2009 commented on code in PR #7319:
URL: https://github.com/apache/incubator-nuttx/pull/7319#discussion_r997589673


##########
fs/procfs/fs_procfs.c:
##########
@@ -858,14 +843,16 @@ static int procfs_readdir(FAR struct inode *mountpt,
        * subdirectory are listed in order in the procfs_entry array.
        */
 
-      if (strncmp(g_procfs_entries[level1->base.index].pathpattern,
+      if (level1->base.index < g_procfs_entrycount &&
+          level1->firstindex < g_procfs_entrycount &&
+          strncmp(g_procfs_entries[level1->base.index].pathpattern,
                   g_procfs_entries[level1->firstindex].pathpattern,
                   level1->subdirlen) == 0)
         {
           /* This entry matches.  Report the subdir entry */
 
-          name = &g_procfs_entries[level1->base.index].pathpattern[
-                    level1->subdirlen + 1];
+          name = &g_procfs_entries[level1->base.index].
+                    pathpattern[level1->subdirlen + 1];

Review Comment:
   @xiaoxiang781216 
   I think this is a style change, so it would be better to merge the change into the first commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org