NSH library: In nsh_argexand(), if CONFIG_NSH_ARGCAT is defined but CONFIG_NSH_CMDPARMS defined and/or CONFIG_DISABLE_ENVIRON not defined, then there is a situation that causes an infinite loop in the parser. Noted by Freddie Chopin.
This commit is contained in:
parent
ad5784b24a
commit
2ef46ce4ba
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/nshlib/nsh_parse.c
|
* apps/nshlib/nsh_parse.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2013, 2014 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2013, 2014, 2017 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -1180,7 +1180,11 @@ static FAR char *nsh_argexpand(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline,
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Just to catch any dangling else clauses */
|
/* Not a special character... skip to the next character in the
|
||||||
|
* cmdline.
|
||||||
|
*/
|
||||||
|
|
||||||
|
working++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user