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
SYNERGY 512 SonarCloud vulnerabilities in Synergy-Core #6971
SYNERGY 512 SonarCloud vulnerabilities in Synergy-Core #6971
Conversation
* Fix all vulnerablilities from SonarCloud besides TLS * Update ChangeLog
2d28932
to
732d21a
Compare
* Fix SonarCloud messages(Code Smells level)
* Fix build on Linux based systems
* Fix Sonar messages
* Fix Sonar messages
* Fix Sonar messages
if (std::find_if(data.begin(), data.end(), | ||
[](const unsigned char& c) { return c < 32 || c > 126; }) != data.end()) { | ||
const String hex_digits = "0123456789abcdef"; | ||
String tmp; | ||
tmp.reserve(data.length() * 3); | ||
std::for_each(data.begin(), data.end(), [hex_digits, &tmp](const unsigned char& c) | ||
{ | ||
tmp += hex_digits[c >> 16]; | ||
tmp += hex_digits[c & 15]; | ||
tmp += ' '; | ||
}); | ||
data = tmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code looks ok but looks like it can be easily moved to separate function with one parameter to reduce the complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside of complexity this code also has logical errors(converting to hex going wrong). 1128 line contains byte offset of uchar but with value 16 instead of 4. I think, that even log changes can lead to problems, when you are not well familiar with projects, that's why I prefer to do my first changes with minimum of intervention. But if you insist - I'll move this part to new function and, also, can fix char conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abatyiev Could you please, create a new task in Jira for the problem with hex conversion.
We will change this code under the new task because it requires thorough investigation.
I will merge this code as is.
* Resolve comment issues
* Fix comments
SonarCloud Quality Gate failed. |
No description provided.