Commit 3ff3104
committed
tests: test code tweaks
Be more cautious on unexpected failures and input:
binder
Avoid returning garbage value from binder_parse() in case of an
unexpected (impossible?) empty buffer.
Store create_bpf_*() results temporarily in an int to actually
perform the error checks (they are currently no-ops on unsigned).
bpf
Initialize variable in case the program gets called without the
associated option.
cap_userns
Use appropriate types and casts to avoid implicit conversions.
execshare
Avoid use of void pointer arithmetic.
fdreceive
Do not call non async-safe exit(3) in signal handler.
Drop dead assignment.
filesystem
Initialize variables in case the programs get called without the
associated options.
inet_socket/unix_socket
Declare usage() as noreturn to help compilers avoid issuing
inaccurate warnings.
inherit
Use a large enough buffer for a potential huge PID.
key_socket
Avoid comparison of signed with unsigned integer.
module_load
Correctly check for an open(2) failure.
nnp_nosuid
Check if wait(2) succeeded before checking the child status.
notify
Check if opening file was successful.
Use appropriate type for read(2) return value.
prlimit
Set all members of the new limit structure.
sctp
Use appropriate iterator type.
Signed-off-by: Christian Göttsche <[email protected]>1 parent 92a7bff commit 3ff3104
File tree
21 files changed
+36
-24
lines changed- tests
- binder
- bpf
- cap_userns
- fdreceive
- filesystem
- inet_socket
- inherit
- key_socket
- module_load
- nnp_nosuid
- notify
- prlimit
- sctp
- unix_socket
21 files changed
+36
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
81 | 81 | | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | | - | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments