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

Need a strict boundary check for resolved? #2

Open
spacewander opened this issue May 21, 2019 · 0 comments
Open

Need a strict boundary check for resolved? #2

spacewander opened this issue May 21, 2019 · 0 comments

Comments

@spacewander
Copy link

In https://github.com/ipipdotnet/ipdb-c/blob/master/ipdb.c#L142:

if (resolved >= reader->file_size) {
        return ErrDatabaseError;
    }

int size = (reader->data[resolved] << 8) | reader->data[resolved + 2];

Maybe we need to replace resolved >= reader->file_size with resolved >= reader->data_size, because the boundary of reader->data is data_size not file_size.

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

No branches or pull requests

1 participant