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 2021/04/03 13:54:47 UTC

[GitHub] [incubator-nuttx] patacongo opened a new pull request #3294: getopt(): Fix Use of Variable before NULL check

patacongo opened a new pull request #3294:
URL: https://github.com/apache/incubator-nuttx/pull/3294


   ## Summary
   
   Found a place in getopt_common() where the option string is used before it is checked if it is NULL.  This can happen because the short option string is optional for getopt_long() and getopt_long_only()
   
   If optstring is NULL, that would be an ERROR for getopt(), but not for the getopt_long() versions.
   
   ## Impact
   
   Should effect only the getopt() APIs
   
   ## Testing
   
   Tested on the simulator using apps/testing/ostest.
   


-- 
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.

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



[GitHub] [incubator-nuttx] patacongo edited a comment on pull request #3294: getopt(): Fix Use of Pointer before NULL check

Posted by GitBox <gi...@apache.org>.
patacongo edited a comment on pull request #3294:
URL: https://github.com/apache/incubator-nuttx/pull/3294#issuecomment-812882034


   > Oh, it seems that patacongo:getopt branch does not include #3289
   
   I rebased the branch.  #3289 should be there now.


-- 
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.

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



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3294: getopt(): Fix Use of Pointer before NULL check

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3294:
URL: https://github.com/apache/incubator-nuttx/pull/3294#issuecomment-812874219


   @patacongo 
   
   Hmm, getopt_test() still fails with esp32-devkitc:smp (QEMU)
   
   ```
   user_main: getopt() test
   getopt():  Simple test
   xtensa_user_panic: User Exception: EXCCAUSE=001c task: ostest
   xtensa_dumpstate: CPU0:
   xtensa_registerdump:    PC: 400de2be    PS: 00060230
   xtensa_registerdump:    A0: 800de045    A1: 3ffec050    A2: 00000006    A3: 3ffec140
   xtensa_registerdump:    A4: 3f40263d    A5: 00000000    A6: 00000000    A7: 3ffec260
   xtensa_registerdump:    A8: 00000000    A9: 3ffec030   A10: 0000002d   A11: 0000000a
   xtensa_registerdump:   A12: 3ffe9e90   A13: 00060020   A14: 0000000c   A15: 3ffec0b0
   xtensa_registerdump:   SAR: 00000020 CAUSE: 0000001c VADDR: 00000006
   xtensa_registerdump:  LBEG: 4000c2e0  LEND: 4000c2f6  LCNT: 00000000
   xtensa_registerdump:  TMP0: 400807da  TMP1: 3ffebe30
   xtensa_btdump: Backtrace0: 400d4927:3ffebdd0
   xtensa_btdump: Backtrace1: 400d4a35:3ffebdf0
   xtensa_btdump: Backtrace2: 400d48b7:3ffebe10
   xtensa_btdump: Backtrace3: 400807f4:3ffebe30
   xtensa_btdump: Backtrace4: 40020:0
   xtensa_btdump: BACKTRACE CORRUPTED!
   xtensa_dumpstate: sp:         3ffebd80
   xtensa_dumpstate: stack base: 3ffec220
   xtensa_dumpstate: stack size: 00002000
   ```


-- 
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.

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



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3294: getopt(): Fix Use of Pointer before NULL check

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3294:
URL: https://github.com/apache/incubator-nuttx/pull/3294#issuecomment-812874879


   >Hmm, getopt_test() still fails with esp32-devkitc:smp (QEMU)
   
   Oh, it seems that patacongo:getopt branch does not include https://github.com/apache/incubator-nuttx/pull/3289
   


-- 
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.

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



[GitHub] [incubator-nuttx] Ouss4 merged pull request #3294: getopt(): Fix Use of Pointer before NULL check

Posted by GitBox <gi...@apache.org>.
Ouss4 merged pull request #3294:
URL: https://github.com/apache/incubator-nuttx/pull/3294


   


-- 
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.

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



[GitHub] [incubator-nuttx] patacongo commented on pull request #3294: getopt(): Fix Use of Pointer before NULL check

Posted by GitBox <gi...@apache.org>.
patacongo commented on pull request #3294:
URL: https://github.com/apache/incubator-nuttx/pull/3294#issuecomment-812882034


   > Oh, it seems that patacongo:getopt branch does not include #3289
   
   I rebased the branch.


-- 
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.

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