Pinned Tweet
Error of comparing the difference of two unsigned numbers with zero,not all of them will really lead to a problem, but this is a mistake.
The developer assumed that in this way he will find out which number is greater, but in fact he will find out whether they are equal.
1
Division by zero.
In situations of weak control of the return value.
github.com/github/codeql/pul…
an interesting problem, if when allocating memory we did not check the size for zero, then after the allocation we will no longer be able to determine whether memory is allocated or not.
github.com/github/codeql/pul…
search for possible situations of dangerous work with the mbtowc call
github.com/github/codeql/pul…
not a new but interesting bug.
we kind of check the certificate, but we forgot the name.
and it is not difficult to make a valid certificate for a different name.
github.com/github/codeql/pul…
It seems to me that everyone forgets about the functions of working with connections.
github.com/github/codeql/pul…
2
the problem of incomplete closure of bidirectional connections, the possibility of disclosure to unauthorized access.
github.com/github/codeql/pul…
Exceptions can not only help but also confuse.
github.com/github/codeql/pul…
I generally consider it dangerous not to check the correctness of the functions.
github.com/github/codeql/pul…
late explicit conversion is always bad. even if you didn't overflow. design looks redundant.
github.com/github/codeql/pul…
if you are working on a file, explicitly set the permissions. you have no idea how often this is forgotten.
github.com/github/codeql/pul…
files, work with them is understandable and transparent. except for the problems of setting rights or prohibitions. how easy it is to get confused by setting the mask to deny or to allow.
github.com/github/codeql/pul…
undefined behavior, why can't we get rid of it at the level of the programming language standard
hard to find and fix if the situation causes the error only under certain conditions.
github.com/github/codeql/pul…
exception without exception, it happens, even often happens.
github.com/github/codeql/pul…
scope is a problem of all times and all languages.
github.com/github/codeql/pul…
double freeing or reclosing resources. difficult to find. some people think it's not a mistake. however, this is a very insidious mistake.
github.com/github/codeql/pul…
github.com/github/codeql/pul…
part 2.
how many errors the refactoring generates. how hard it is to look for them, because each line looks very logical.
github.com/github/securityla…
how many errors the refactoring generates. how hard it is to look for them, because each line looks very logical.
github.com/github/codeql/pul…
checking after that is a very good indicator that a check is needed, but a check after is useless.)
github.com/github/codeql/pul…
precedence operators and logical operators can confuse anyone.
github.com/github/codeql/pul…
confusion about exclusion of memory, the developer tries to make the program stable. But it only gets worse.
github.com/github/codeql/pul…
