| Summary: | stack corruption in read_config_file() | ||
|---|---|---|---|
| Product: | SDL_sound | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | everything | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED ENDOFLIFE | QA Contact: | Ryan C. Gordon <icculus> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
This is obsolete now |
There is a stack corruption in read_config_file() where the words index for the w[] array becomes equal to MAXWORDS. The following simple patch fixes it. diff -r 719dade41745 decoders/timidity/timidity.c --- a/decoders/timidity/timidity.c Wed Aug 15 23:52:18 2012 -0400 +++ b/decoders/timidity/timidity.c Sun Feb 08 19:00:41 2015 +0200 @@ -113,8 +113,10 @@ static int read_config_file(char *name) if (*w[0] == '#') continue; - while (w[words] && *w[words] != '#' && (words < MAXWORDS)) - w[++words]=strtok(0," \t\240"); + while (w[words] && *w[words] != '#') { + if (++words == MAXWORDS) break; + w[words]=strtok(NULL, " \t\240"); + } /* * TiMidity++ adds a number of extensions to the config file format.