Skip to content

Conversation

@JianyuWang0623
Copy link
Contributor

Summary

The NSH hangs after exec the test command.
nsh_redirect() needs to save three fd(stderr, stdout and stdin) but array length is only two, stack buffer overflowed!

  • Config
  sim:nsh
  • Command
  cat < /etc/init.d/rc.sysinit

Related: #2469

Impact

nsh/redirect

Testing

  • Selftest as summary shown
  • Apache:NuttX CI

Board/Config/Command
  sim:nsh
  cat < /etc/init.d/rc.sysinit

Problem
  The NSH hangs after exec the test command.
  `nsh_redirect()` needs to save three fd but array length is only two, stack buffer overflowed!

Related: apache#2469

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
@JianyuWang0623 JianyuWang0623 force-pushed the br_wjy_nsh_redirect_stack_1012 branch from 7ad700f to 47830e9 Compare October 12, 2024 11:50
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @JianyuWang0623 :-)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
@JianyuWang0623 JianyuWang0623 force-pushed the br_wjy_nsh_redirect_stack_1012 branch from 47830e9 to ca74f6d Compare October 13, 2024 00:20
@xiaoxiang781216 xiaoxiang781216 merged commit 2bfe2c2 into apache:master Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants