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

Prevent overflow of matrix interation values #40

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Prevent overflow of matrix interation values #40

merged 1 commit into from
Apr 3, 2024

Conversation

sangmo-kang
Copy link
Contributor

@sangmo-kang sangmo-kang commented Apr 3, 2024

Dear Maintainer.

When creating a matrix, if the maxLinesPerFile exceeds 65535, the matrix size is determined by the overflowed value.
This can cause a segmentation fault when initializing the matrix using fill.
Also, when comparing two files, if the product of the number of lines in both files exceeds 4294967295, there is a possibility to access the index using the overflowed value.
I suggest changing the variable type that can be used as the matrix index from unsigned to size_t.

Thanks.

@dlidstrom
Copy link
Owner

Hi @sangmo-kang ! Thanks for your contribution. It looks like the build isn't working any longer. I'll see if I can get it to work and then I'll merge your PR.

@dlidstrom dlidstrom merged commit 83a009d into dlidstrom:master Apr 3, 2024
3 of 6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants