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

Fix or tag as allowed all uses of unsigned integer overflow, add add -fsanitize=unsigned-integer-overflow to the Travis sanitize configuration #1782

Merged
merged 1 commit into from Aug 20, 2019

Conversation

rouault
Copy link
Member

@rouault rouault commented Aug 15, 2019

No description provided.

@rouault
Copy link
Member Author

rouault commented Aug 15, 2019

That PR might be a bit controversial as it effectively "bans" a well-defined behaviour of C/C++, that is underflow/overflow on unsigned integer arithmetic. However there are potential for real bugs to be hidden by such a behaviour (I or other contributors fixed a few instances of that in a few previous commits), so it seems reasonable to try to avoid it when possible, and when not possible, to tag the functions where this is explicitly allowed with CPL_NOSANITIZE_UNSIGNED_INT_OVERFLOW

Copy link
Contributor

@abellgithub abellgithub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments apply to other similar changes.

gdal/frmts/gtiff/libtiff/tif_dirread.c Show resolved Hide resolved
gdal/frmts/hdf4/hdf4multidim.cpp Show resolved Hide resolved
gdal/frmts/hdf5/hdf5multidim.cpp Outdated Show resolved Hide resolved
gdal/frmts/netcdf/netcdfmultidim.cpp Outdated Show resolved Hide resolved
gdal/frmts/rmf/rmflzw.cpp Show resolved Hide resolved
gdal/frmts/vrt/vrtmultidim.cpp Outdated Show resolved Hide resolved
gdal/gcore/gdalmultidim.cpp Show resolved Hide resolved
…-fsanitize=unsigned-integer-overflow to the Travis sanitize configuration
@rouault rouault merged commit 1fbae5b into OSGeo:master Aug 20, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants