Windrow14 opened a new pull request, #2658:
URL: https://github.com/apache/nuttx-apps/pull/2658

   ## Summary
   
   argv[argn] is accessed out of range when there are neither four partitions 
are specified nor the last partition is of auto size.
   `mkmbr /dev/mmcsd1 233 666 auto 1234` -> `partn = 2` -> `argv[6]` -> panic
   ```
   #0  0x4005544b in ?? ()
   #1  0x42056a90 in mkmbr_main (argc=<optimized out>, argv=<optimized out>) at 
mkmbr.c:140
   #2  0x42007449 in nxtask_startup (entrypt=0x420569e8 <mkmbr_main>, argc=6, 
argv=0x3ca01a60) at sched/task_startup.c:70
   #3  0x42003be4 in nxtask_start () at task/task_start.c:114
   ```
   
   Fix the problem by adding a number of partition variable `nr_part` based on 
input argument number.
   
   ## Impact
   
   Null pointer bug fixed.
   Make `mkmbr` command support divide the device into less than four 
partitions with space left at the end.
   
   ## Testing
   
   ```
   nsh> mkmbr /dev/mmcsd1 233 666 auto 1234
   nsh> 
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to