Add some simple fixes to possible bugs identified with cppcheck#14
Add some simple fixes to possible bugs identified with cppcheck#14aiden-ct wants to merge 3 commits intopine64:masterfrom
Conversation
e4fc2c4 to
eab79b0
Compare
|
I'm somewhat against automatically fixing code. Let's have a look at "Add some protection against NULL pointer dereference". if aad_len > 0 then aad should be not NULL. Let's assume that is the case, then the current code would crash, we notice that, root-cause and fix it. With the proposed fix, we would skip the if block and happily continue execution. But doesn't the following code assume that the skipped if block got actually executed? Would that not result in erronous computations? This issue should be fixed manually by verifying function arguments, e.g. the beginning of the function should check that if aad_len > 0 then aad != NULL and return -EINVAL otherwise. And so every potential issue should be manually inspected and fixed the right way. |
eab79b0 to
045c4c3
Compare
|
@schaecsn - these patches weren't generated automatically, but I take your point on that specific example. I've updated the PR to reflect. |
Clean components: fix whitespace in components/
5acb2ea to
3c827b2
Compare
Run
cppcheck --force .to see full list of errors and warnings identified. Needs some configuration to parse the source fully.