Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing past end of an array. #6

Open
GoogleCodeExporter opened this issue Mar 4, 2016 · 0 comments
Open

Writing past end of an array. #6

GoogleCodeExporter opened this issue Mar 4, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

The function "locateFileStart" is writing beyond the end of the array
"cookedName".  In both "for loops" the test should be "i < 11" instead of
"i < 12".

See below:

    char cookedName[11];
    for(int i = 0; i < 12; ++i) {
      cookedName[i] = 0x20;
    }
    for (int i = 0, j = 0; i < 12 && filename[i]; ++i) {
      if (filename[i] != '.') {
        cookedName[j] = filename[i] >= 96 ? filename[i] - 32 : filename[i];
        ++j;
      } else {
        j = 8;
      }
    }

Original issue reported on code.google.com by ott.ra...@gmail.com on 20 Jul 2009 at 4:23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant