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

Potential Errors overrunning-write-with-float Related to CWE-120 #15336

Open
Close-Recover opened this issue Mar 13, 2024 · 0 comments
Open

Potential Errors overrunning-write-with-float Related to CWE-120 #15336

Close-Recover opened this issue Mar 13, 2024 · 0 comments

Comments

@Close-Recover
Copy link

Dear developers,

When we use CodeQL (GitHub's own static code analysis tool) to analyze the project, it has reported some errors from code that may cause breakdown. And we found that these potential errors tend to exist in the project for a relatively long time. In this issue we will provide the errors form a single file third_party/rtklib/rtkcmn.c, including their names and locations. Hopefully they will get your attention, and we are looking forward to further communication.

System information

  • OS Platform and Distribution: Linux Ubuntu 18.04
  • Apollo installed from: source
  • Apollo version: 9.0, but some appears in a much earlier version like 6.0
  • Output of apollo.sh config if on master branch: no output can be given because the analysis was run just after standard installation

Steps to reproduce the issue:

  • Prepare everything by following the guidance of official docs before running './apollo.sh build'
  • Then use CodeQL create database command to establish database and set '--command = './apollo.sh build'', it looks like: codeql database create new-database --language=<language> --command='./apollo.sh build'
  • Please note that the process needs a clean build and may take a long time to finish. Using clean command and parallelization techniques based on your hardware environment may help you make it faster

Supporting materials (screenshots, command lines, code/script snippets):

  • Because of the limit of GitHub, we cannot attach the original file directly. You can contact us by email to obtain it: 2654209843@qq.com
  • **Here are some errors' information that were reported as the most important, they are focused on overrunning-write-with-float: Buffer write operations that do not control the length of data written may overflow when floating point inputs take extreme values, which is related to CWE-20:

Line: 3708, 3710, 3712, 3714, 3716, 3718, 3720:
This 'call to sprintf' operation may require 311 bytes because of float conversions, but the target is only 64 bytes.
image

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