tools/cvsparser.c: Add a check to avoid access past the end of a fixed size array

This commit is contained in:
Gregory Nutt 2017-12-21 12:37:10 -06:00
parent c431177c0f
commit 35b12f7f0f

View File

@ -213,6 +213,12 @@ int parse_csvline(char *ptr)
do
{
if (nparams >= MAX_FIELDS)
{
fprintf(stderr, "%d: Too many Parameters: \"%s\"\n", g_lineno, g_line);
exit(8);
}
ptr = copy_parm(ptr, &g_parm[nparms][0]);
nparms++;
ptr = find_parm(ptr);