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

checks: Fix code scanning CodeQL overflow warnings #2168

Merged
merged 2 commits into from Feb 14, 2022

Conversation

nilason
Copy link
Contributor

@nilason nilason commented Feb 4, 2022

Touching files with PR #2165 triggered CodeQL overflow warnings.

This PR addresses these issues:

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

- Multiplication result may overflow 'int' before it is converted to 'long'.
- Multiplication result may overflow 'int' before it is converted to 'unsigned long'.
@nilason nilason added this to the 8.2.0 milestone Feb 5, 2022
@nilason nilason added C Related code is in C enhancement New feature or request labels Feb 5, 2022
lib/ogsf/gs3.c Outdated Show resolved Hide resolved
@nilason
Copy link
Contributor Author

nilason commented Feb 9, 2022

If there are no objections, I’ll merge this soon.

@nilason nilason merged commit e8ef996 into OSGeo:main Feb 14, 2022
@nilason nilason deleted the fix-codeql-errors branch February 14, 2022 09:03
@wenzeslaus wenzeslaus changed the title Fix some code scanning CodeQL overflow warnings checks: Fix some code scanning CodeQL overflow warnings Apr 27, 2022
@wenzeslaus wenzeslaus changed the title checks: Fix some code scanning CodeQL overflow warnings checks: Fix code scanning CodeQL overflow warnings Apr 27, 2022
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
* Fix some code scanning CodeQL overflow warnings

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

Use size_t instead of long for pointer arithmetics.
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
* Fix some code scanning CodeQL overflow warnings

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

Use size_t instead of long for pointer arithmetics.
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
* Fix some code scanning CodeQL overflow warnings

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

Use size_t instead of long for pointer arithmetics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants