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

Fix some potential overflow issues #1161

Merged
merged 2 commits into from
Oct 31, 2018
Merged

Fix some potential overflow issues #1161

merged 2 commits into from
Oct 31, 2018

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Oct 23, 2018

Put sizeof to the beginning of the multiplication to enforce that
size_t instead of smaller integer types is used for the calculation.

This fixes warnings from LGTM:

Multiplication result may overflow 'unsigned int'
before it is converted to 'unsigned long'.

It also allows removing some type casts.

Signed-off-by: Stefan Weil sw@weilnetz.de

Put sizeof to the beginning of the multiplication to enforce that
size_t instead of smaller integer types is used for the calculation.

This fixes warnings from LGTM:

    Multiplication result may overflow 'unsigned int'
    before it is converted to 'unsigned long'.

It also allows removing some type casts.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
@rouault rouault merged commit 948332e into uclouvain:master Oct 31, 2018
@stweil stweil deleted the lgtm branch October 31, 2018 21:06
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.

None yet

2 participants