OXIESEC PANEL
- Current Dir:
/
/
usr
/
src
/
linux-headers-4.15.0-197
/
scripts
/
coccinelle
/
misc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/17/2022 06:42:18 AM
rwxr-xr-x
📄
array_size.cocci
1.66 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
badty.cocci
1.68 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
boolconv.cocci
1.44 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
boolinit.cocci
2.2 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
boolreturn.cocci
698 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
bugon.cocci
1.45 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cond_no_effect.cocci
2.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cstptr.cocci
827 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
doubleinit.cocci
1.36 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ifaddr.cocci
659 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
ifcol.cocci
1.21 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
irqf_oneshot.cocci
1.91 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
noderef.cocci
1.17 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
of_table.cocci
1.33 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
orplus.cocci
1 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
returnvar.cocci
1.22 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
semicolon.cocci
1.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
warn.cocci
1.62 KB
01/28/2018 09:20:33 PM
rw-r--r--
Editing: badty.cocci
Close
/// Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element /// //# This makes an effort to find cases where the argument to sizeof is wrong //# in memory allocation functions by checking the type of the allocated memory //# when it is a double pointer and ensuring the sizeof argument takes a pointer //# to the the memory being allocated. There are false positives in cases the //# sizeof argument is not used in constructing the return value. The result //# may need some reformatting. // // Confidence: Moderate // Copyright: (C) 2014 Himangi Saraogi. GPLv2. // Comments: // Options: virtual patch virtual context virtual org virtual report //---------------------------------------------------------- // For context mode //---------------------------------------------------------- @depends on context disable sizeof_type_expr@ type T; T **x; @@ x = <+...sizeof( * T )...+> //---------------------------------------------------------- // For patch mode //---------------------------------------------------------- @depends on patch disable sizeof_type_expr@ type T; T **x; @@ x = <+...sizeof( - T + *x )...+> //---------------------------------------------------------- // For org and report mode //---------------------------------------------------------- @r depends on (org || report) disable sizeof_type_expr@ type T; T **x; position p; @@ x = <+...sizeof( T@p )...+> @script:python depends on org@ p << r.p; @@ coccilib.org.print_todo(p[0], "WARNING sizeof argument should be pointer type, not structure type") @script:python depends on report@ p << r.p; @@ msg="WARNING: Use correct pointer type argument for sizeof" coccilib.report.print_report(p[0], msg)