We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2315 - Array w going out of boundary in read_config_file function
Summary: Array w going out of boundary in read_config_file function
Status: RESOLVED DUPLICATE of bug 2966
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 1.2.12
Hardware: x86 Linux
: P2 critical
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 09:09 UTC by Nitz
Modified: 2015-05-05 05:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nitz 2013-12-18 09:09:58 UTC
In static int read_config_file(const char *name) function array going out of boundary at :

while (w[words] && (words < MAXWORDS))
      {
        w[++words]=strtok(0," \t\r\n\240");
        if (w[words] && w[words][0]=='#') break;
      }
here w[++words] will go out of boundary when words = MAXWORDS
So to avoid this, fix should be:

while (w[words] && (++words < MAXWORDS))
      {
        w[words]=strtok(0," \t\r\n\240");
        if (w[words] && w[words][0]=='#') break;
      }

Thanks...
Comment 1 Ozkan Sezer 2015-05-03 09:08:11 UTC
This is a dup of #2872 (and #2966)
Comment 2 Sam Lantinga 2015-05-05 05:13:56 UTC
This is a duplicate of 2966

*** This bug has been marked as a duplicate of bug 2966 ***