clang -cc1 -cc1 -triple amd64-unknown-openbsd7.0 -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name pmap_prot2.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 1 -pic-is-pie -mframe-pointer=all -relaxed-aliasing -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/lib/libc/obj -resource-dir /usr/local/lib/clang/13.0.0 -include namespace.h -I /usr/src/lib/libc/include -I /usr/src/lib/libc/hidden -D __LIBC__ -D APIWARN -D YP -I /usr/src/lib/libc/yp -I /usr/src/lib/libc -I /usr/src/lib/libc/gdtoa -I /usr/src/lib/libc/arch/amd64/gdtoa -D INFNAN_CHECK -D MULTIPLE_THREADS -D NO_FENV_H -D USE_LOCALE -I /usr/src/lib/libc -I /usr/src/lib/libc/citrus -D RESOLVSORT -D FLOATING_POINT -D PRINTF_WIDE_CHAR -D SCANF_WIDE_CHAR -D FUTEX -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/usr/src/lib/libc/obj -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/ben/Projects/vmm/scan-build/2022-01-12-194120-40624-1 -x c /usr/src/lib/libc/rpc/pmap_prot2.c
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 | |
33 | |
34 | |
35 | |
36 | |
37 | |
38 | |
39 | #include <rpc/types.h> |
40 | #include <rpc/xdr.h> |
41 | #include <rpc/pmap_prot.h> |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | |
48 | |
49 | |
50 | |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | |
62 | |
63 | |
64 | |
65 | |
66 | |
67 | |
68 | |
69 | |
70 | |
71 | |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | bool_t |
83 | xdr_pmaplist(XDR *xdrs, struct pmaplist **rp) |
84 | { |
85 | |
86 | |
87 | |
88 | |
89 | |
90 | bool_t more_elements; |
91 | int freeing = (xdrs->x_op == XDR_FREE); |
| 1 | Assuming field 'x_op' is equal to XDR_FREE | |
|
92 | struct pmaplist **next; |
93 | |
94 | while (TRUE) { |
| 2 | | Loop condition is true. Entering loop body | |
|
| 14 | | Loop condition is true. Entering loop body | |
|
95 | more_elements = (bool_t)(*rp != NULL); |
| 3 | | Assuming the condition is false | |
|
| 15 | | Dereference of null pointer (loaded from variable 'rp') |
|
96 | if (! xdr_bool(xdrs, &more_elements)) |
| 4 | | Assuming the condition is false | |
|
| |
97 | return (FALSE); |
98 | if (! more_elements) |
| 6 | | Assuming 'more_elements' is not equal to 0 | |
|
| |
99 | return (TRUE); |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | if (freeing) |
| |
106 | next = &((*rp)->pml_next); |
| 9 | | Null pointer value stored to 'next' | |
|
107 | if (! xdr_reference(xdrs, (caddr_t *)rp, |
| 10 | | Assuming the condition is false | |
|
| |
108 | (u_int)sizeof(struct pmaplist), xdr_pmap)) |
109 | return (FALSE); |
110 | rp = (freeing) ? next : &((*rp)->pml_next); |
| |
| 13 | | Null pointer value stored to 'rp' | |
|
111 | } |
112 | } |
113 | DEF_WEAK(xdr_pmaplist); |