We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5c6f4f commit e645166Copy full SHA for e645166
cpp/ql/src/Critical/InconsistentNullnessTesting.cpp
@@ -1,10 +1,10 @@
1
void* f() {
2
- block = malloc(BLOCK_SIZE);
+ block = (MyBlock *)malloc(sizeof(MyBlock));
3
if (block) { //correct: block is checked for nullness here
4
block->id = NORMAL_BLOCK_ID;
5
}
6
//...
7
/* make sure data-portion is null-terminated */
8
- block[BLOCK_SIZE - 1] = '\0'; //wrong: block not checked for nullness here
+ block->data[BLOCK_SIZE - 1] = '\0'; //wrong: block not checked for nullness here
9
return block;
10
0 commit comments