Skip to content

Commit

Permalink
[Argtable3] stack corruption for long arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
chipweinberger committed Oct 20, 2022
1 parent ac315ad commit 7915973
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/console/argtable3/argtable3.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,11 @@ static void arg_cat(char** pdest, const char* src, size_t* pndest) {
char* end = dest + *pndest;

/*locate null terminator of dest string */
while (dest < end && *dest != 0)
while (dest < end-1 && *dest != 0)
dest++;

/* concat src string to dest string */
while (dest < end && *src != 0)
while (dest < end-1 && *src != 0)
*dest++ = *src++;

/* null terminate dest string */
Expand Down

0 comments on commit 7915973

Please sign in to comment.