Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/txt_db/txt_db.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | TXT_DB *TXT_DB_read(BIO *in, int num) | - | ||||||||||||||||||||||||
7 | { | - | ||||||||||||||||||||||||
8 | TXT_DB *ret = | - | ||||||||||||||||||||||||
9 | ((void *)0) | - | ||||||||||||||||||||||||
10 | ; | - | ||||||||||||||||||||||||
11 | int esc = 0; | - | ||||||||||||||||||||||||
12 | long ln = 0; | - | ||||||||||||||||||||||||
13 | int i, add, n; | - | ||||||||||||||||||||||||
14 | int size = 512; | - | ||||||||||||||||||||||||
15 | int offset = 0; | - | ||||||||||||||||||||||||
16 | char *p, *f; | - | ||||||||||||||||||||||||
17 | OPENSSL_STRING *pp; | - | ||||||||||||||||||||||||
18 | BUF_MEM *buf = | - | ||||||||||||||||||||||||
19 | ((void *)0) | - | ||||||||||||||||||||||||
20 | ; | - | ||||||||||||||||||||||||
21 | - | |||||||||||||||||||||||||
22 | if ((
| 0-8 | ||||||||||||||||||||||||
23 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
24 | ) | - | ||||||||||||||||||||||||
25 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
26 | if (!BUF_MEM_grow(buf, size)
| 0-8 | ||||||||||||||||||||||||
27 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||
29 | if ((
| 0-8 | ||||||||||||||||||||||||
30 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
31 | ) | - | ||||||||||||||||||||||||
32 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
33 | ret->num_fields = num; | - | ||||||||||||||||||||||||
34 | ret->index = | - | ||||||||||||||||||||||||
35 | ((void *)0) | - | ||||||||||||||||||||||||
36 | ; | - | ||||||||||||||||||||||||
37 | ret->qual = | - | ||||||||||||||||||||||||
38 | ((void *)0) | - | ||||||||||||||||||||||||
39 | ; | - | ||||||||||||||||||||||||
40 | if ((
| 0-8 | ||||||||||||||||||||||||
41 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
42 | ) | - | ||||||||||||||||||||||||
43 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
44 | if ((
| 0-8 | ||||||||||||||||||||||||
45 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
46 | ) | - | ||||||||||||||||||||||||
47 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
48 | if ((
| 0-8 | ||||||||||||||||||||||||
49 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
50 | ) | - | ||||||||||||||||||||||||
51 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
52 | for (i = 0; i < num
| 8-48 | ||||||||||||||||||||||||
53 | ret->index[i] = | - | ||||||||||||||||||||||||
54 | ((void *)0) | - | ||||||||||||||||||||||||
55 | ; | - | ||||||||||||||||||||||||
56 | ret->qual[i] = | - | ||||||||||||||||||||||||
57 | ((void *)0) | - | ||||||||||||||||||||||||
58 | ; | - | ||||||||||||||||||||||||
59 | } executed 48 times by 1 test: end of block Executed by:
| 48 | ||||||||||||||||||||||||
60 | - | |||||||||||||||||||||||||
61 | add = (num + 1) * sizeof(char *); | - | ||||||||||||||||||||||||
62 | buf->data[size - 1] = '\0'; | - | ||||||||||||||||||||||||
63 | offset = 0; | - | ||||||||||||||||||||||||
64 | for (;;) { | - | ||||||||||||||||||||||||
65 | if (offset != 0
| 8-13 | ||||||||||||||||||||||||
66 | size += 512; | - | ||||||||||||||||||||||||
67 | if (!BUF_MEM_grow_clean(buf, size)
| 0-8 | ||||||||||||||||||||||||
68 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
69 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
70 | buf->data[offset] = '\0'; | - | ||||||||||||||||||||||||
71 | BIO_gets(in, &(buf->data[offset]), size - offset); | - | ||||||||||||||||||||||||
72 | ln++; | - | ||||||||||||||||||||||||
73 | if (buf->data[offset] == '\0'
| 8-13 | ||||||||||||||||||||||||
74 | break; executed 8 times by 1 test: break; Executed by:
| 8 | ||||||||||||||||||||||||
75 | if ((
| 0-8 | ||||||||||||||||||||||||
76 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
77 | i = strlen(&(buf->data[offset])); | - | ||||||||||||||||||||||||
78 | offset += i; | - | ||||||||||||||||||||||||
79 | if (buf->data[offset - 1] != '\n'
| 5-8 | ||||||||||||||||||||||||
80 | continue; executed 8 times by 1 test: continue; Executed by:
| 8 | ||||||||||||||||||||||||
81 | else { | - | ||||||||||||||||||||||||
82 | buf->data[offset - 1] = '\0'; | - | ||||||||||||||||||||||||
83 | if ((
| 0-5 | ||||||||||||||||||||||||
84 | ((void *)0)
| 0-5 | ||||||||||||||||||||||||
85 | ) | - | ||||||||||||||||||||||||
86 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
87 | offset = 0; | - | ||||||||||||||||||||||||
88 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
89 | pp = (char **)p; | - | ||||||||||||||||||||||||
90 | p += add; | - | ||||||||||||||||||||||||
91 | n = 0; | - | ||||||||||||||||||||||||
92 | pp[n++] = p; | - | ||||||||||||||||||||||||
93 | i = 0; | - | ||||||||||||||||||||||||
94 | f = buf->data; | - | ||||||||||||||||||||||||
95 | - | |||||||||||||||||||||||||
96 | esc = 0; | - | ||||||||||||||||||||||||
97 | for (;;) { | - | ||||||||||||||||||||||||
98 | if (*
| 5-5750 | ||||||||||||||||||||||||
99 | break; executed 5 times by 1 test: break; Executed by:
| 5 | ||||||||||||||||||||||||
100 | if (*
| 25-5725 | ||||||||||||||||||||||||
101 | if (esc
| 0-25 | ||||||||||||||||||||||||
102 | p--; never executed: p--; | 0 | ||||||||||||||||||||||||
103 | else { | - | ||||||||||||||||||||||||
104 | *(p++) = '\0'; | - | ||||||||||||||||||||||||
105 | f++; | - | ||||||||||||||||||||||||
106 | if (n >= num
| 0-25 | ||||||||||||||||||||||||
107 | break; never executed: break; | 0 | ||||||||||||||||||||||||
108 | pp[n++] = p; | - | ||||||||||||||||||||||||
109 | continue; executed 25 times by 1 test: continue; Executed by:
| 25 | ||||||||||||||||||||||||
110 | } | - | ||||||||||||||||||||||||
111 | } | - | ||||||||||||||||||||||||
112 | esc = (*f == '\\'); | - | ||||||||||||||||||||||||
113 | *(p++) = *(f++); | - | ||||||||||||||||||||||||
114 | } executed 5725 times by 1 test: end of block Executed by:
| 5725 | ||||||||||||||||||||||||
115 | *(p++) = '\0'; | - | ||||||||||||||||||||||||
116 | if ((
| 0-5 | ||||||||||||||||||||||||
117 | CRYPTO_free(pp, __FILE__, 107); | - | ||||||||||||||||||||||||
118 | ret->error = 6; | - | ||||||||||||||||||||||||
119 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
120 | } | - | ||||||||||||||||||||||||
121 | pp[n] = p; | - | ||||||||||||||||||||||||
122 | if (!sk_OPENSSL_PSTRING_push(ret->data, pp)
| 0-5 | ||||||||||||||||||||||||
123 | CRYPTO_free(pp, __FILE__, 113); | - | ||||||||||||||||||||||||
124 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
125 | } | - | ||||||||||||||||||||||||
126 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
127 | BUF_MEM_free(buf); | - | ||||||||||||||||||||||||
128 | return executed 8 times by 1 test: ret;return ret; Executed by:
executed 8 times by 1 test: return ret; Executed by:
| 8 | ||||||||||||||||||||||||
129 | err: | - | ||||||||||||||||||||||||
130 | BUF_MEM_free(buf); | - | ||||||||||||||||||||||||
131 | if (ret !=
| 0 | ||||||||||||||||||||||||
132 | ((void *)0)
| 0 | ||||||||||||||||||||||||
133 | ) { | - | ||||||||||||||||||||||||
134 | sk_OPENSSL_PSTRING_free(ret->data); | - | ||||||||||||||||||||||||
135 | CRYPTO_free(ret->index, __FILE__, 123); | - | ||||||||||||||||||||||||
136 | CRYPTO_free(ret->qual, __FILE__, 124); | - | ||||||||||||||||||||||||
137 | CRYPTO_free(ret, __FILE__, 125); | - | ||||||||||||||||||||||||
138 | } never executed: end of block | 0 | ||||||||||||||||||||||||
139 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
140 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
141 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
142 | } | - | ||||||||||||||||||||||||
143 | - | |||||||||||||||||||||||||
144 | OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx, | - | ||||||||||||||||||||||||
145 | OPENSSL_STRING *value) | - | ||||||||||||||||||||||||
146 | { | - | ||||||||||||||||||||||||
147 | OPENSSL_STRING *ret; | - | ||||||||||||||||||||||||
148 | struct lhash_st_OPENSSL_STRING *lh; | - | ||||||||||||||||||||||||
149 | - | |||||||||||||||||||||||||
150 | if (idx >= db->num_fields
| 0-4 | ||||||||||||||||||||||||
151 | db->error = 3; | - | ||||||||||||||||||||||||
152 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
153 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
154 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
155 | } | - | ||||||||||||||||||||||||
156 | lh = db->index[idx]; | - | ||||||||||||||||||||||||
157 | if (lh ==
| 0-4 | ||||||||||||||||||||||||
158 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
159 | ) { | - | ||||||||||||||||||||||||
160 | db->error = 4; | - | ||||||||||||||||||||||||
161 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
162 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
163 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||
164 | } | - | ||||||||||||||||||||||||
165 | ret = lh_OPENSSL_STRING_retrieve(lh, value); | - | ||||||||||||||||||||||||
166 | db->error = 0; | - | ||||||||||||||||||||||||
167 | return executed 4 times by 1 test: ret;return ret; Executed by:
executed 4 times by 1 test: return ret; Executed by:
| 4 | ||||||||||||||||||||||||
168 | } | - | ||||||||||||||||||||||||
169 | - | |||||||||||||||||||||||||
170 | int TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *), | - | ||||||||||||||||||||||||
171 | OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp) | - | ||||||||||||||||||||||||
172 | { | - | ||||||||||||||||||||||||
173 | struct lhash_st_OPENSSL_STRING *idx; | - | ||||||||||||||||||||||||
174 | OPENSSL_STRING *r, *k; | - | ||||||||||||||||||||||||
175 | int i, n; | - | ||||||||||||||||||||||||
176 | - | |||||||||||||||||||||||||
177 | if (field >= db->num_fields
| 0-4 | ||||||||||||||||||||||||
178 | db->error = 3; | - | ||||||||||||||||||||||||
179 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
180 | } | - | ||||||||||||||||||||||||
181 | - | |||||||||||||||||||||||||
182 | if ((
| 0-4 | ||||||||||||||||||||||||
183 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
184 | ) { | - | ||||||||||||||||||||||||
185 | db->error = 1; | - | ||||||||||||||||||||||||
186 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
187 | } | - | ||||||||||||||||||||||||
188 | n = sk_OPENSSL_PSTRING_num(db->data); | - | ||||||||||||||||||||||||
189 | for (i = 0; i < n
| 2-4 | ||||||||||||||||||||||||
190 | r = sk_OPENSSL_PSTRING_value(db->data, i); | - | ||||||||||||||||||||||||
191 | if ((
| 1 | ||||||||||||||||||||||||
192 | ((void *)0)
| 1 | ||||||||||||||||||||||||
193 | )
| 0-1 | ||||||||||||||||||||||||
194 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
195 | if ((
| 0-2 | ||||||||||||||||||||||||
196 | ((void *)0)
| 0-2 | ||||||||||||||||||||||||
197 | ) { | - | ||||||||||||||||||||||||
198 | db->error = 2; | - | ||||||||||||||||||||||||
199 | db->arg1 = sk_OPENSSL_PSTRING_find(db->data, k); | - | ||||||||||||||||||||||||
200 | db->arg2 = i; | - | ||||||||||||||||||||||||
201 | lh_OPENSSL_STRING_free(idx); | - | ||||||||||||||||||||||||
202 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
203 | } | - | ||||||||||||||||||||||||
204 | if (lh_OPENSSL_STRING_retrieve(idx, r) ==
| 0-2 | ||||||||||||||||||||||||
205 | ((void *)0)
| 0-2 | ||||||||||||||||||||||||
206 | ) { | - | ||||||||||||||||||||||||
207 | db->error = 1; | - | ||||||||||||||||||||||||
208 | lh_OPENSSL_STRING_free(idx); | - | ||||||||||||||||||||||||
209 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
210 | } | - | ||||||||||||||||||||||||
211 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||||||||||||||||||||
212 | lh_OPENSSL_STRING_free(db->index[field]); | - | ||||||||||||||||||||||||
213 | db->index[field] = idx; | - | ||||||||||||||||||||||||
214 | db->qual[field] = qual; | - | ||||||||||||||||||||||||
215 | return executed 4 times by 1 test: 1;return 1; Executed by:
executed 4 times by 1 test: return 1; Executed by:
| 4 | ||||||||||||||||||||||||
216 | } | - | ||||||||||||||||||||||||
217 | - | |||||||||||||||||||||||||
218 | long TXT_DB_write(BIO *out, TXT_DB *db) | - | ||||||||||||||||||||||||
219 | { | - | ||||||||||||||||||||||||
220 | long i, j, n, nn, l, tot = 0; | - | ||||||||||||||||||||||||
221 | char *p, **pp, *f; | - | ||||||||||||||||||||||||
222 | BUF_MEM *buf = | - | ||||||||||||||||||||||||
223 | ((void *)0) | - | ||||||||||||||||||||||||
224 | ; | - | ||||||||||||||||||||||||
225 | long ret = -1; | - | ||||||||||||||||||||||||
226 | - | |||||||||||||||||||||||||
227 | if ((
| 0-4 | ||||||||||||||||||||||||
228 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
229 | ) | - | ||||||||||||||||||||||||
230 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
231 | n = sk_OPENSSL_PSTRING_num(db->data); | - | ||||||||||||||||||||||||
232 | nn = db->num_fields; | - | ||||||||||||||||||||||||
233 | for (i = 0; i < n
| 4-5 | ||||||||||||||||||||||||
234 | pp = sk_OPENSSL_PSTRING_value(db->data, i); | - | ||||||||||||||||||||||||
235 | - | |||||||||||||||||||||||||
236 | l = 0; | - | ||||||||||||||||||||||||
237 | for (j = 0; j < nn
| 5-30 | ||||||||||||||||||||||||
238 | if (pp[j] !=
| 4-26 | ||||||||||||||||||||||||
239 | ((void *)0)
| 4-26 | ||||||||||||||||||||||||
240 | ) | - | ||||||||||||||||||||||||
241 | l += strlen(pp[j]); executed 26 times by 1 test: l += strlen(pp[j]); Executed by:
| 26 | ||||||||||||||||||||||||
242 | } executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||||||||||||||||||||
243 | if (!BUF_MEM_grow_clean(buf, (int)(l * 2 + nn))
| 0-5 | ||||||||||||||||||||||||
244 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
245 | - | |||||||||||||||||||||||||
246 | p = buf->data; | - | ||||||||||||||||||||||||
247 | for (j = 0; j < nn
| 5-30 | ||||||||||||||||||||||||
248 | f = pp[j]; | - | ||||||||||||||||||||||||
249 | if (f !=
| 4-26 | ||||||||||||||||||||||||
250 | ((void *)0)
| 4-26 | ||||||||||||||||||||||||
251 | ) | - | ||||||||||||||||||||||||
252 | for (;;) { | - | ||||||||||||||||||||||||
253 | if (*
| 26-3103 | ||||||||||||||||||||||||
254 | break; executed 26 times by 1 test: break; Executed by:
| 26 | ||||||||||||||||||||||||
255 | if (*
| 0-3103 | ||||||||||||||||||||||||
256 | *( never executed: p++) = '\\';*(p++) = '\\'; never executed: *(p++) = '\\'; | 0 | ||||||||||||||||||||||||
257 | *(p++) = *(f++); | - | ||||||||||||||||||||||||
258 | } executed 3103 times by 1 test: end of block Executed by:
| 3103 | ||||||||||||||||||||||||
259 | *(p++) = '\t'; | - | ||||||||||||||||||||||||
260 | } executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||||||||||||||||||||
261 | p[-1] = '\n'; | - | ||||||||||||||||||||||||
262 | j = p - buf->data; | - | ||||||||||||||||||||||||
263 | if (BIO_write(out, buf->data, (int)j) != j
| 0-5 | ||||||||||||||||||||||||
264 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
265 | tot += j; | - | ||||||||||||||||||||||||
266 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
267 | ret = tot; | - | ||||||||||||||||||||||||
268 | err: code before this statement executed 4 times by 1 test: err: Executed by:
| 4 | ||||||||||||||||||||||||
269 | BUF_MEM_free(buf); | - | ||||||||||||||||||||||||
270 | return executed 4 times by 1 test: ret;return ret; Executed by:
executed 4 times by 1 test: return ret; Executed by:
| 4 | ||||||||||||||||||||||||
271 | } | - | ||||||||||||||||||||||||
272 | - | |||||||||||||||||||||||||
273 | int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) | - | ||||||||||||||||||||||||
274 | { | - | ||||||||||||||||||||||||
275 | int i; | - | ||||||||||||||||||||||||
276 | OPENSSL_STRING *r; | - | ||||||||||||||||||||||||
277 | - | |||||||||||||||||||||||||
278 | for (i = 0; i < db->num_fields
| 4-24 | ||||||||||||||||||||||||
279 | if (db->index[i] !=
| 4-20 | ||||||||||||||||||||||||
280 | ((void *)0)
| 4-20 | ||||||||||||||||||||||||
281 | ) { | - | ||||||||||||||||||||||||
282 | if ((
| 2 | ||||||||||||||||||||||||
283 | ((void *)0)
| 2 | ||||||||||||||||||||||||
284 | )
| 0-2 | ||||||||||||||||||||||||
285 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
286 | r = lh_OPENSSL_STRING_retrieve(db->index[i], row); | - | ||||||||||||||||||||||||
287 | if (r !=
| 0-4 | ||||||||||||||||||||||||
288 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
289 | ) { | - | ||||||||||||||||||||||||
290 | db->error = 2; | - | ||||||||||||||||||||||||
291 | db->arg1 = i; | - | ||||||||||||||||||||||||
292 | db->arg_row = r; | - | ||||||||||||||||||||||||
293 | goto never executed: err;goto err; never executed: goto err; | 0 | ||||||||||||||||||||||||
294 | } | - | ||||||||||||||||||||||||
295 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
296 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||||||||||||||
297 | - | |||||||||||||||||||||||||
298 | for (i = 0; i < db->num_fields
| 4-24 | ||||||||||||||||||||||||
299 | if (db->index[i] !=
| 4-20 | ||||||||||||||||||||||||
300 | ((void *)0)
| 4-20 | ||||||||||||||||||||||||
301 | ) { | - | ||||||||||||||||||||||||
302 | if ((
| 2 | ||||||||||||||||||||||||
303 | ((void *)0)
| 2 | ||||||||||||||||||||||||
304 | )
| 0-2 | ||||||||||||||||||||||||
305 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
306 | (void)lh_OPENSSL_STRING_insert(db->index[i], row); | - | ||||||||||||||||||||||||
307 | if (lh_OPENSSL_STRING_retrieve(db->index[i], row) ==
| 0-4 | ||||||||||||||||||||||||
308 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||
309 | ) | - | ||||||||||||||||||||||||
310 | goto never executed: err1;goto err1; never executed: goto err1; | 0 | ||||||||||||||||||||||||
311 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||||||||||||||
312 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||||||||||||||
313 | if (!sk_OPENSSL_PSTRING_push(db->data, row)
| 0-4 | ||||||||||||||||||||||||
314 | goto never executed: err1;goto err1; never executed: goto err1; | 0 | ||||||||||||||||||||||||
315 | return executed 4 times by 1 test: 1;return 1; Executed by:
executed 4 times by 1 test: return 1; Executed by:
| 4 | ||||||||||||||||||||||||
316 | - | |||||||||||||||||||||||||
317 | err1: | - | ||||||||||||||||||||||||
318 | db->error = 1; | - | ||||||||||||||||||||||||
319 | while (i-- > 0
| 0 | ||||||||||||||||||||||||
320 | if (db->index[i] !=
| 0 | ||||||||||||||||||||||||
321 | ((void *)0)
| 0 | ||||||||||||||||||||||||
322 | ) { | - | ||||||||||||||||||||||||
323 | if ((
| 0 | ||||||||||||||||||||||||
324 | ((void *)0)
| 0 | ||||||||||||||||||||||||
325 | )
| 0 | ||||||||||||||||||||||||
326 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
327 | (void)lh_OPENSSL_STRING_delete(db->index[i], row); | - | ||||||||||||||||||||||||
328 | } never executed: end of block | 0 | ||||||||||||||||||||||||
329 | } never executed: end of block | 0 | ||||||||||||||||||||||||
330 | err: code before this statement never executed: err: | 0 | ||||||||||||||||||||||||
331 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||||||||
332 | } | - | ||||||||||||||||||||||||
333 | - | |||||||||||||||||||||||||
334 | void TXT_DB_free(TXT_DB *db) | - | ||||||||||||||||||||||||
335 | { | - | ||||||||||||||||||||||||
336 | int i, n; | - | ||||||||||||||||||||||||
337 | char **p, *max; | - | ||||||||||||||||||||||||
338 | - | |||||||||||||||||||||||||
339 | if (db ==
| 2-8 | ||||||||||||||||||||||||
340 | ((void *)0)
| 2-8 | ||||||||||||||||||||||||
341 | ) | - | ||||||||||||||||||||||||
342 | return; executed 2 times by 1 test: return; Executed by:
| 2 | ||||||||||||||||||||||||
343 | if (db->index !=
| 0-8 | ||||||||||||||||||||||||
344 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
345 | ) { | - | ||||||||||||||||||||||||
346 | for (i = db->num_fields - 1; i >= 0
| 8-48 | ||||||||||||||||||||||||
347 | lh_OPENSSL_STRING_free(db->index[i]); executed 48 times by 1 test: lh_OPENSSL_STRING_free(db->index[i]); Executed by:
| 48 | ||||||||||||||||||||||||
348 | CRYPTO_free(db->index, __FILE__, 292); | - | ||||||||||||||||||||||||
349 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
350 | CRYPTO_free(db->qual, __FILE__, 294); | - | ||||||||||||||||||||||||
351 | if (db->data !=
| 0-8 | ||||||||||||||||||||||||
352 | ((void *)0)
| 0-8 | ||||||||||||||||||||||||
353 | ) { | - | ||||||||||||||||||||||||
354 | for (i = sk_OPENSSL_PSTRING_num(db->data) - 1; i >= 0
| 8-9 | ||||||||||||||||||||||||
355 | - | |||||||||||||||||||||||||
356 | - | |||||||||||||||||||||||||
357 | - | |||||||||||||||||||||||||
358 | - | |||||||||||||||||||||||||
359 | p = sk_OPENSSL_PSTRING_value(db->data, i); | - | ||||||||||||||||||||||||
360 | max = p[db->num_fields]; | - | ||||||||||||||||||||||||
361 | if (max ==
| 4-5 | ||||||||||||||||||||||||
362 | ((void *)0)
| 4-5 | ||||||||||||||||||||||||
363 | ) { | - | ||||||||||||||||||||||||
364 | for (n = 0; n < db->num_fields
| 4-24 | ||||||||||||||||||||||||
365 | CRYPTO_free(p[n], __FILE__, 305); executed 24 times by 1 test: CRYPTO_free(p[n], __FILE__, 305); Executed by:
| 24 | ||||||||||||||||||||||||
366 | } executed 4 times by 1 test: else {end of block Executed by:
| 4 | ||||||||||||||||||||||||
367 | for (n = 0; n < db->num_fields
| 5-30 | ||||||||||||||||||||||||
368 | if (((
| 0-30 | ||||||||||||||||||||||||
369 | CRYPTO_free(p[n], __FILE__, 309); never executed: CRYPTO_free(p[n], __FILE__, 309); | 0 | ||||||||||||||||||||||||
370 | } executed 30 times by 1 test: end of block Executed by:
| 30 | ||||||||||||||||||||||||
371 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||||||||||||||
372 | CRYPTO_free(sk_OPENSSL_PSTRING_value(db->data, i), __FILE__, 312); | - | ||||||||||||||||||||||||
373 | } executed 9 times by 1 test: end of block Executed by:
| 9 | ||||||||||||||||||||||||
374 | sk_OPENSSL_PSTRING_free(db->data); | - | ||||||||||||||||||||||||
375 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
376 | CRYPTO_free(db, __FILE__, 316); | - | ||||||||||||||||||||||||
377 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |