Skip to content

Memory management update, SonarCloud fixes, fix for issue #841#842

Merged
uweseimet merged 25 commits intodevelopfrom
feature_memory_management_update
Sep 15, 2022
Merged

Memory management update, SonarCloud fixes, fix for issue #841#842
uweseimet merged 25 commits intodevelopfrom
feature_memory_management_update

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

@uweseimet uweseimet commented Sep 10, 2022

Just for the record: The false positives I mentioned previously are only reported by SonarLint, not by SonarCloud.

@uweseimet uweseimet linked an issue Sep 10, 2022 that may be closed by this pull request
@uweseimet uweseimet marked this pull request as ready for review September 10, 2022 10:48
@uweseimet
Copy link
Copy Markdown
Contributor Author

uweseimet commented Sep 10, 2022

@akuker The Raspian buster compiler complained:

./devices/ctapdriver.cpp: In function ‘bool br_setif(int, const char*, const char*, bool)’:
./devices/ctapdriver.cpp:45:9: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 16 equals destination size [-Werror=stringop-truncation]
  strncpy(ifr.ifr_name, bridgename, IFNAMSIZ);
  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IMO the compiler is right (don't know why other compilers don't report it), because if IFNAMSIZE bytes are copied the terminating null byte would be missing. Maybe -Wextra checks for different issues with different gcc versions.
I added the fix to the branch for this PR. This had already been taken care of in a different location of ctapdriver.cpp.

We defniitely have to get rid of char arrays in favor of std::string, which is something also reported by SonarCloud.

@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 19 Code Smells

30.2% 30.2% Coverage
0.0% 0.0% Duplication

@uweseimet uweseimet linked an issue Sep 11, 2022 that may be closed by this pull request
@akuker
Copy link
Copy Markdown
Member

akuker commented Sep 15, 2022

@uweseimet - looks good. feel free to merge at your discretion.

@uweseimet uweseimet merged commit 241e739 into develop Sep 15, 2022
@uweseimet uweseimet deleted the feature_memory_management_update branch September 15, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal Server Error when reattaching ISO image Add/Fix SonarCloud code coverage support, fix more issues

2 participants