Skip to content

r.kappa: Fix unchecked return value from library in stats.c #6011

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

Merged
merged 2 commits into from
Jul 3, 2025

Conversation

ShubhamDesai
Copy link
Contributor

This pull request fixes issue identified by Coverity Scan ( CID : 1207210)
The warning was caused by an unchecked return value from the remove() function, which may fail and return a non-zero error code. In this fix, the return value of remove() is explicitly checked, and a warning is logged if the file removal fails. This follows a more defensive programming approach.

An alternative fix would have been to suppress the warning using a (void) cast, since the program exits immediately afterward via G_fatal_error().

@github-actions github-actions bot added raster Related to raster data processing C Related code is in C module labels Jul 1, 2025
@ShubhamDesai ShubhamDesai changed the title r,kappa: Fix unchecked return value from library in stats.c r.kappa: Fix unchecked return value from library in stats.c Jul 1, 2025
@nilason nilason added this to the 8.5.0 milestone Jul 2, 2025
@github-project-automation github-project-automation bot moved this to In Progress in GRASS GIS Security Jul 2, 2025
@marisn marisn merged commit 93f69d1 into OSGeo:main Jul 3, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in GRASS GIS Security Jul 3, 2025
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 module raster Related to raster data processing
Projects
Development

Successfully merging this pull request may close these issues.

3 participants