mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
Fix segfault on 'rem <verylongline>'
This commit is contained in:
parent
5eda1ea400
commit
8ce20320b2
1 changed files with 6 additions and 0 deletions
|
@ -149,6 +149,7 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
|
|||
int len = strlen(str);
|
||||
memset(ctx->buf, 0x00, ARRAYLEN(ctx->buf));
|
||||
char *bufptr = ctx->buf;
|
||||
char *bufptrend = ctx->buf + ARRAYLEN(ctx->buf) - 1;
|
||||
char *spaceptr = NULL;
|
||||
enum ParserState state = PS_FIRST;
|
||||
|
||||
|
@ -198,6 +199,11 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
|
|||
bufptr++;
|
||||
break;
|
||||
}
|
||||
if (bufptr > bufptrend) {
|
||||
PrintAndLogEx(ERR, "ERROR: Line too long\n");
|
||||
fflush(stdout);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return CLIParserParseArg(ctx, argc, argv, vargtable, vargtableLen, allowEmptyExec);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue