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

Remove functionality from File.h to fix undefined behaviour #1225

Merged
merged 7 commits into from
Jan 16, 2024

Conversation

RobinTF
Copy link
Collaborator

@RobinTF RobinTF commented Jan 14, 2024

The function ad_utiliyt::File::readFile was was subject to undefined behaviour if the buffer passed to the function does not contain a null terminator. This function is now completely removed and its only usage is replaced by std::ifstream.
Also some parts of the class ad_utility::File are cleaned up by removing unused functionality and unused includes.

Copy link

codecov bot commented Jan 14, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (34af3a7) 84.30% compared to head (6e7c6b8) 84.31%.

Files Patch % Lines
src/util/File.h 87.09% 3 Missing and 1 partial ⚠️
src/engine/Operation.cpp 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1225      +/-   ##
==========================================
+ Coverage   84.30%   84.31%   +0.01%     
==========================================
  Files         304      304              
  Lines       29091    29057      -34     
  Branches     3440     3437       -3     
==========================================
- Hits        24524    24500      -24     
+ Misses       3163     3157       -6     
+ Partials     1404     1400       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@joka921 joka921 left a comment

Choose a reason for hiding this comment

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

I have two very minor suggestions.

src/util/File.h Outdated Show resolved Hide resolved
src/util/File.h Show resolved Hide resolved
Copy link

sonarcloud bot commented Jan 16, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

7 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@joka921 joka921 merged commit c668051 into ad-freiburg:master Jan 16, 2024
18 checks passed
@RobinTF RobinTF deleted the file-fixes branch January 16, 2024 17:28
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