Limiting maximum command line arguments by CONFIG_JERRY_MAX_COMMAND_LINE_ARGS configuration option.
This commit is contained in:
@@ -154,4 +154,9 @@
|
||||
// #define CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
|
||||
#endif /* CONFIG_ECMA_COMPACT_PROFILE */
|
||||
|
||||
/**
|
||||
* Maximum number of arguments in the engine's command line (i.e. maximum argc value)
|
||||
*/
|
||||
#define CONFIG_JERRY_MAX_COMMAND_LINE_ARGS 64
|
||||
|
||||
#endif /* !CONFIG_H */
|
||||
|
||||
+6
-1
@@ -138,7 +138,12 @@ int
|
||||
main (int argc __unused,
|
||||
char **argv __unused)
|
||||
{
|
||||
const char *file_names[argc];
|
||||
if (argc > CONFIG_JERRY_MAX_COMMAND_LINE_ARGS)
|
||||
{
|
||||
jerry_exit (ERR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
const char *file_names[CONFIG_JERRY_MAX_COMMAND_LINE_ARGS];
|
||||
bool parse_only = false, show_opcodes = false;
|
||||
bool print_mem_stats = false;
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user