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

Missing boundary check #1

Open
theolivenbaum opened this issue Nov 16, 2021 · 3 comments
Open

Missing boundary check #1

theolivenbaum opened this issue Nov 16, 2021 · 3 comments

Comments

@theolivenbaum
Copy link

Hi, just to let you know, it seems like there is a missing boundary check on this line too:

result[band + 4 * (resultPos++)] = data[dataPos + 1];

Changing the code to this fixes the issue:

for (int i = 0; i < count; i++)
{
    var idx = band + 4 * (resultPos++);
    if (idx < result.Length)
    result[idx] = data[dataPos + 1];
}
@preseverence
Copy link
Member

Didn't encounter cases where it breaks, but anyway that branch must be stabilized too. Thx.

@theolivenbaum
Copy link
Author

Strange, we were hitting that often on macOS Monterey, most icons from the macOS preferences were throwing there

@preseverence preseverence reopened this Nov 17, 2021
@preseverence
Copy link
Member

Is everything ok now, with the recent commit? Also you can send me that icons somehow for experiments.
Actually, I don't work much with icns. So the issue was discovered just recently.

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

No branches or pull requests

2 participants