58781d5782
sizeof when applied to a pointer typed expression gives the size of the pointer and not the size of the object associated with the pointer expression leading to errors. This scripts checks for inconsistencies where sizeof is incorrectly used, especially while calculating size of memory to be allocated in memory allocating functions. Eg: - memset(pStr, 0, sizeof(pStr)); + memset(pStr, 0, sizeof(*pStr)); Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com> |
||
---|---|---|
.. | ||
array_size.cocci | ||
deref_null.cocci | ||
ignore_return.cocci | ||
irq_lock.cocci | ||
mini_lock.cocci | ||
noderef.cocci | ||
semicolon.cocci | ||
unsigned_lesser_than_zero.cocci | ||
unsigned_shift.cocci |