Skip to content

Commit

Permalink
buffer overrun.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdelnero committed Nov 14, 2023
1 parent c300305 commit 91f8d99
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib_jtag_core/src/script/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ char * arrayresize(char * array, int size, unsigned char c)
array = malloc(DEFAULT_BUFLEN);
if(array)
{
size = DEFAULT_BUFLEN / 2;
memset(array,0,DEFAULT_BUFLEN);
}

Expand All @@ -1258,7 +1259,7 @@ char * arrayresize(char * array, int size, unsigned char c)
}
else
{
ptr[ (size * 2) ] = 0;
ptr[ (size * 2) - 1 ] = 0;
}
}

Expand Down

0 comments on commit 91f8d99

Please sign in to comment.