badty.cocci (f29f24b5568fd6169e0363c78f1a80db38d0e7e9) badty.cocci (7f904d7e1f3ec7c2de47c024a5a5c30988b54703)
1// SPDX-License-Identifier: GPL-2.0-only
1/// Correct the size argument to alloc functions
2///
3//# This makes an effort to find cases where the argument to sizeof is wrong
4//# in memory allocation functions by checking the type of the allocated memory
5//# when it is a double pointer and ensuring the sizeof argument takes a pointer
6//# to the the memory being allocated. There are false positives in cases the
7//# sizeof argument is not used in constructing the return value. The result
8//# may need some reformatting.
9//
10// Confidence: Moderate
2/// Correct the size argument to alloc functions
3///
4//# This makes an effort to find cases where the argument to sizeof is wrong
5//# in memory allocation functions by checking the type of the allocated memory
6//# when it is a double pointer and ensuring the sizeof argument takes a pointer
7//# to the the memory being allocated. There are false positives in cases the
8//# sizeof argument is not used in constructing the return value. The result
9//# may need some reformatting.
10//
11// Confidence: Moderate
11// Copyright: (C) 2014 Himangi Saraogi. GPLv2.
12// Copyright: (C) 2014 Himangi Saraogi.
12// Comments:
13// Options:
14
15virtual patch
16virtual context
17virtual org
18virtual report
19

--- 57 unchanged lines hidden ---
13// Comments:
14// Options:
15
16virtual patch
17virtual context
18virtual org
19virtual report
20

--- 57 unchanged lines hidden ---