OpenCoverage

async_wait.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/async/async_wait.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3ASYNC_WAIT_CTX *ASYNC_WAIT_CTX_new(void)-
4{-
5 return
executed 5 times by 1 test: return CRYPTO_zalloc(sizeof(ASYNC_WAIT_CTX), __FILE__, 17);
Executed by:
  • libcrypto.so.1.1
CRYPTO_zalloc(sizeof(ASYNC_WAIT_CTX), __FILE__, 17);
executed 5 times by 1 test: return CRYPTO_zalloc(sizeof(ASYNC_WAIT_CTX), __FILE__, 17);
Executed by:
  • libcrypto.so.1.1
5
6}-
7-
8void ASYNC_WAIT_CTX_free(ASYNC_WAIT_CTX *ctx)-
9{-
10 struct fd_lookup_st *curr;-
11 struct fd_lookup_st *next;-
12-
13 if (ctx ==
ctx == ((void *)0)Description
TRUEevaluated 8254 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-8254
14 ((void *)0)
ctx == ((void *)0)Description
TRUEevaluated 8254 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5-8254
15 )-
16 return;
executed 8254 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
8254
17-
18 curr = ctx->fds;-
19 while (curr !=
curr != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
20 ((void *)0)
curr != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
21 ) {-
22 if (!curr->del
!curr->delDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
23-
24 if (curr->cleanup !=
curr->cleanup != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
25 ((void *)0)
curr->cleanup != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
26 )-
27 curr->cleanup(ctx, curr->key, curr->fd, curr->custom_data);
never executed: curr->cleanup(ctx, curr->key, curr->fd, curr->custom_data);
0
28 }
never executed: end of block
0
29-
30 next = curr->next;-
31 CRYPTO_free(curr, __FILE__, 37);-
32 curr = next;-
33 }
never executed: end of block
0
34-
35 CRYPTO_free(ctx, __FILE__, 41);-
36}
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
37int ASYNC_WAIT_CTX_set_wait_fd(ASYNC_WAIT_CTX *ctx, const void *key,-
38 int fd, void *custom_data,-
39 void (*cleanup)(ASYNC_WAIT_CTX *, const void *,-
40 int, void *))-
41{-
42 struct fd_lookup_st *fdlookup;-
43-
44 if ((
(fdlookup = CR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
fdlookup = CRYPTO_zalloc(sizeof(*fdlookup), __FILE__, 50)) ==
(fdlookup = CR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
45 ((void *)0)
(fdlookup = CR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
46 ) {-
47 ERR_put_error(51,(106),((1|64)),__FILE__,51);-
48 return
never executed: return 0;
0;
never executed: return 0;
0
49 }-
50-
51 fdlookup->key = key;-
52 fdlookup->fd = fd;-
53 fdlookup->custom_data = custom_data;-
54 fdlookup->cleanup = cleanup;-
55 fdlookup->add = 1;-
56 fdlookup->next = ctx->fds;-
57 ctx->fds = fdlookup;-
58 ctx->numadd++;-
59 return
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2
60}-
61-
62int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,-
63 int *fd, void **custom_data)-
64{-
65 struct fd_lookup_st *curr;-
66-
67 curr = ctx->fds;-
68 while (curr !=
curr != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
69 ((void *)0)
curr != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
70 ) {-
71 if (curr->del
curr->delDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
72-
73 curr = curr->next;-
74 continue;
never executed: continue;
0
75 }-
76 if (curr->key == key
curr->key == keyDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
77 *fd = curr->fd;-
78 *custom_data = curr->custom_data;-
79 return
never executed: return 1;
1;
never executed: return 1;
0
80 }-
81 curr = curr->next;-
82 }
never executed: end of block
0
83 return
never executed: return 0;
0;
never executed: return 0;
0
84}-
85-
86int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, int *fd,-
87 size_t *numfds)-
88{-
89 struct fd_lookup_st *curr;-
90-
91 curr = ctx->fds;-
92 *numfds = 0;-
93 while (curr !=
curr != ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-5
94 ((void *)0)
curr != ((void *)0)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
3-5
95 ) {-
96 if (curr->del
curr->delDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1-2
97-
98 curr = curr->next;-
99 continue;
executed 1 time by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
1
100 }-
101 if (fd !=
fd != ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1
102 ((void *)0)
fd != ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1
103 ) {-
104 *fd = curr->fd;-
105 fd++;-
106 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
107 (*numfds)++;-
108 curr = curr->next;-
109 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
110 return
executed 5 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 5 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
5
111}-
112-
113int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, int *addfd,-
114 size_t *numaddfds, int *delfd,-
115 size_t *numdelfds)-
116{-
117 struct fd_lookup_st *curr;-
118-
119 *numaddfds = ctx->numadd;-
120 *numdelfds = ctx->numdel;-
121 if (addfd ==
addfd == ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-5
122 ((void *)0)
addfd == ((void *)0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-5
123 && delfd ==
delfd == ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-4
124 ((void *)0)
delfd == ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
1-4
125 )-
126 return
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4
127-
128 curr = ctx->fds;-
129-
130 while (curr !=
curr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2
131 ((void *)0)
curr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2
132 ) {-
133-
134 if (curr->del
curr->delDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !curr->add
!curr->addDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(delfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
delfd !=
(delfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
135 ((void *)0)
(delfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
136 )
(delfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
137 *delfd = curr->fd;-
138 delfd++;-
139 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
140 if (curr->add
curr->addDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& !curr->del
!curr->delDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(addfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
addfd !=
(addfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
141 ((void *)0)
(addfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
142 )
(addfd != ((void *)0) )Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
143 *addfd = curr->fd;-
144 addfd++;-
145 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
146 curr = curr->next;-
147 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
2
148-
149 return
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 2 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
2
150}-
151-
152int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key)-
153{-
154 struct fd_lookup_st *curr, *prev;-
155-
156 curr = ctx->fds;-
157 prev = -
158 ((void *)0)-
159 ;-
160 while (curr !=
curr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2
161 ((void *)0)
curr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-2
162 ) {-
163 if (curr->del == 1
curr->del == 1Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-2
164-
165 prev = curr;-
166 curr = curr->next;-
167 continue;
never executed: continue;
0
168 }-
169 if (curr->key == key
curr->key == keyDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-2
170-
171 if (curr->add == 1
curr->add == 1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1
172 if (ctx->fds == curr
ctx->fds == currDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
173 ctx->fds = curr->next;-
174 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
1
175 prev->next = curr->next;-
176 }
never executed: end of block
0
177-
178-
179-
180-
181 CRYPTO_free(curr, __FILE__, 165);-
182 ctx->numadd--;-
183 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
184 }-
185-
186-
187-
188-
189-
190-
191 curr->del = 1;-
192 ctx->numdel++;-
193 return
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 1 time by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1
194 }-
195 prev = curr;-
196 curr = curr->next;-
197 }
never executed: end of block
0
198 return
never executed: return 0;
0;
never executed: return 0;
0
199}-
200-
201void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx)-
202{-
203 struct fd_lookup_st *curr, *prev = -
204 ((void *)0)-
205 ;-
206-
207 ctx->numadd = 0;-
208 ctx->numdel = 0;-
209-
210 curr = ctx->fds;-
211-
212 while (curr !=
curr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-9
213 ((void *)0)
curr != ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-9
214 ) {-
215 if (curr->del
curr->delDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
1
216 if (prev ==
prev == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
217 ((void *)0)
prev == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
218 )-
219 ctx->fds = curr->next;
executed 1 time by 1 test: ctx->fds = curr->next;
Executed by:
  • libcrypto.so.1.1
1
220 else-
221 prev->next = curr->next;
never executed: prev->next = curr->next;
0
222 CRYPTO_free(curr, __FILE__, 200);-
223 if (prev ==
prev == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
224 ((void *)0)
prev == ((void *)0)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-1
225 )-
226 curr = ctx->fds;
executed 1 time by 1 test: curr = ctx->fds;
Executed by:
  • libcrypto.so.1.1
1
227 else-
228 curr = prev->next;
never executed: curr = prev->next;
0
229 continue;
executed 1 time by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
1
230 }-
231 if (curr->add
curr->addDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-1
232 curr->add = 0;-
233 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
234 prev = curr;-
235 curr = curr->next;-
236 }
executed 1 time by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1
237}
executed 9 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
9
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2