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 some "unsafe vector access" warnings #2275

Merged
merged 1 commit into from
Jul 9, 2022

Conversation

kevinbackhouse
Copy link
Collaborator

Fix a few of the "unsafe vector access" warnings flagged by CodeQL.

@kevinbackhouse kevinbackhouse added this to the v1.00 milestone Jul 8, 2022
@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #2275 (b9b2d77) into main (118731d) will increase coverage by 0.01%.
The diff coverage is 37.50%.

@@            Coverage Diff             @@
##             main    #2275      +/-   ##
==========================================
+ Coverage   63.46%   63.48%   +0.01%     
==========================================
  Files         118      118              
  Lines       19598    19595       -3     
  Branches     9556     9557       +1     
==========================================
+ Hits        12438    12440       +2     
+ Misses       5094     5091       -3     
+ Partials     2066     2064       -2     
Impacted Files Coverage Δ
src/pngimage.cpp 60.10% <0.00%> (-0.17%) ⬇️
src/nikonmn_int.cpp 57.14% <20.00%> (+0.03%) ⬆️
src/image.cpp 69.57% <83.33%> (ø)
src/jp2image.cpp 70.26% <0.00%> (+0.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 118731d...b9b2d77. Read the comment docs.

Copy link
Collaborator

@piponazo piponazo left a comment

Choose a reason for hiding this comment

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

nice cleanup

for (int i = 0; i < 16; i++) {
value[tolower(hexdigits[i])] = i + 1;
value[toupper(hexdigits[i])] = i + 1;
for (int i = 0; i < 10; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ha, nice one

@kevinbackhouse kevinbackhouse merged commit 2c31430 into Exiv2:main Jul 9, 2022
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.

2 participants