Top 10 errors in C and C++ projects in 2023
New Year is coming! It means, according to tradition, it's time to recall 10 of the most interesting bugs that PVS-Studio found during 2023.
Top 10 errors in C and C++ projects in 2023
by Alexey Gorshkov
From the article:
In this case, the developers wanted to fill the keyEventList array with zeros. Pay attention to the third parameter — the number of bytes the developers wanted to fill with zeros. In this case, sizeof(keyEventList) evaluates the pointer size instead of the array size. It depends on the target platform, but most often it's 4 or 8 bytes. However, the size of the structure is clearly larger than 4 or 8 bytes.

A new episode of the series about SObjectizer and message passing:
A new episode of the series about SObjectizer and message passing:
We’ll look at the basics of data flow analysis, including how it works in general, while presenting several real-world examples where it can help you write better code.
A new episode of the series about SObjectizer and message passing: