-
-
Notifications
You must be signed in to change notification settings - Fork 327
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
lib/raster: fixed security vulnerabilities and weaknesses #3549
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some suggestion. In general it is advisable to constrain buffer sizes defined by constants like GPATH_MAX
to include null terminator (i.e. not to increase it with 1).
I am not certain why the MacOS job failed. |
Just to make sure I made a rerun of the job, and still failed early. The earliest possible error that I was only able to spot was the linker not being able to link libgrass, but didn’t find another more descriptive error in the compilation. |
I'm surprised that another Clang-based job didn't fail. I only see that Travis builds with gcc and clang, but on Ubuntu focal. I thought we had more clang jobs than that. |
In the CI log you can find the reason:
which is the same issue as the CodeQL reports. |
The macOS CI is built with |
Is this ready now that CI passes? |
Yes, it is ready now. |
This PR fixes three vulnerabilities/weaknesses found with older scans of Coverity.
Issue 1208372 in error.c concerns an unbounded read of an environment variable into memory. An attacker could overwrite the environment variable that is accessed by G__home() and exploit it to overflow the buf array.
Issue 1501330 in mapset_msc.c concerns writing into an array that is not null terminated. If the path variable was not null terminated, the write could fill the whole array with data without a null terminator, causing trouble down the line.
Issue 1207344 in raster/r.gwflow/main.c concerns a constant variable guarding dead code. This is not exactly a security vulnerability, but is a code quality issue I was able to easily fix.