apollo
apollo copied to clipboard
Potential Errors overrunning-write-with-float Related to CWE-120
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 configif onmasterbranch: 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: [email protected]
- **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 toCWE-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.