OpenCoverage

txt_db.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/txt_db/txt_db.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6TXT_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 ((
(buf = BUF_MEM...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
buf = BUF_MEM_new()) ==
(buf = BUF_MEM...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
23 ((void *)0)
(buf = BUF_MEM...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
24 )-
25 goto
never executed: goto err;
err;
never executed: goto err;
0
26 if (!BUF_MEM_grow(buf, size)
!BUF_MEM_grow(buf, size)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8
27 goto
never executed: goto err;
err;
never executed: goto err;
0
28-
29 if ((
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret = CRYPTO_malloc(sizeof(*ret), __FILE__, 37)) ==
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
30 ((void *)0)
(ret = CRYPTO_...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
31 )-
32 goto
never executed: goto err;
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 ((
(ret->data = s...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret->data = sk_OPENSSL_PSTRING_new_null()) ==
(ret->data = s...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
41 ((void *)0)
(ret->data = s...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
42 )-
43 goto
never executed: goto err;
err;
never executed: goto err;
0
44 if ((
(ret->index = ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret->index = CRYPTO_malloc(sizeof(*ret->index) * num, __FILE__, 44)) ==
(ret->index = ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
45 ((void *)0)
(ret->index = ...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
46 )-
47 goto
never executed: goto err;
err;
never executed: goto err;
0
48 if ((
(ret->qual = C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret->qual = CRYPTO_malloc(sizeof(*(ret->qual)) * num, __FILE__, 46)) ==
(ret->qual = C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
49 ((void *)0)
(ret->qual = C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-8
50 )-
51 goto
never executed: goto err;
err;
never executed: goto err;
0
52 for (i = 0; i < num
i < numDescription
TRUEevaluated 48 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
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:
  • libcrypto.so.1.1
48
60-
61 add = (num + 1) * sizeof(char *);-
62 buf->data[size - 1] = '\0';-
63 offset = 0;-
64 for (;;) {-
65 if (offset != 0
offset != 0Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
8-13
66 size += 512;-
67 if (!BUF_MEM_grow_clean(buf, size)
!BUF_MEM_grow_clean(buf, size)Description
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8
68 goto
never executed: goto err;
err;
never executed: goto err;
0
69 }
executed 8 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8
70 buf->data[offset] = '\0';-
71 BIO_gets(in, &(buf->data[offset]), size - offset);-
72 ln++;-
73 if (buf->data[offset] == '\0'
buf->data[offset] == '\0'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 13 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
8-13
74 break;
executed 8 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
8
75 if ((
(offset == 0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
offset == 0)
(offset == 0)Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
&& (
(buf->data[0] == '#')Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
buf->data[0] == '#')
(buf->data[0] == '#')Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-8
76 continue;
never executed: continue;
0
77 i = strlen(&(buf->data[offset]));-
78 offset += i;-
79 if (buf->data[offset - 1] != '\n'
buf->data[offset - 1] != '\n'Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5-8
80 continue;
executed 8 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
8
81 else {-
82 buf->data[offset - 1] = '\0';-
83 if ((
(p = CRYPTO_ma...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p = CRYPTO_malloc(add + offset, __FILE__, 75)) ==
(p = CRYPTO_ma...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
84 ((void *)0)
(p = CRYPTO_ma...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-5
85 )-
86 goto
never executed: goto err;
err;
never executed: goto err;
0
87 offset = 0;-
88 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
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 (*
*f == '\0'Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5750 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
f == '\0'
*f == '\0'Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5750 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
5-5750
99 break;
executed 5 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
5
100 if (*
*f == '\t'Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
f == '\t'
*f == '\t'Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5725 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
25-5725
101 if (esc
escDescription
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-25
102 p--;
never executed: p--;
0
103 else {-
104 *(p++) = '\0';-
105 f++;-
106 if (n >= num
n >= numDescription
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-25
107 break;
never executed: break;
0
108 pp[n++] = p;-
109 continue;
executed 25 times by 1 test: continue;
Executed by:
  • libcrypto.so.1.1
25
110 }-
111 }-
112 esc = (*f == '\\');-
113 *(p++) = *(f++);-
114 }
executed 5725 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5725
115 *(p++) = '\0';-
116 if ((
(n != num)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
n != num)
(n != num)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (*
(*f != '\0')Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
f != '\0')
(*f != '\0')Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5
117 CRYPTO_free(pp, __FILE__, 107);-
118 ret->error = 6;-
119 goto
never executed: goto err;
err;
never executed: goto err;
0
120 }-
121 pp[n] = p;-
122 if (!sk_OPENSSL_PSTRING_push(ret->data, pp)
!sk_OPENSSL_PS...ret->data, pp)Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-5
123 CRYPTO_free(pp, __FILE__, 113);-
124 goto
never executed: goto err;
err;
never executed: goto err;
0
125 }-
126 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
127 BUF_MEM_free(buf);-
128 return
executed 8 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 8 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
8
129 err:-
130 BUF_MEM_free(buf);-
131 if (ret !=
ret != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
132 ((void *)0)
ret != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
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-
144OPENSSL_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
idx >= db->num_fieldsDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
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 ==
lh == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
158 ((void *)0)
lh == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 4 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
4
168}-
169-
170int 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
field >= db->num_fieldsDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-4
178 db->error = 3;-
179 return
never executed: return 0;
0;
never executed: return 0;
0
180 }-
181-
182 if ((
(idx = (struct...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
idx = (struct lhash_st_OPENSSL_STRING *)OPENSSL_LH_new(hash, cmp)) ==
(idx = (struct...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
183 ((void *)0)
(idx = (struct...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
184 ) {-
185 db->error = 1;-
186 return
never executed: return 0;
0;
never executed: return 0;
0
187 }-
188 n = sk_OPENSSL_PSTRING_num(db->data);-
189 for (i = 0; i < n
i < nDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
2-4
190 r = sk_OPENSSL_PSTRING_value(db->data, i);-
191 if ((
(qual != ((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
qual !=
(qual != ((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
192 ((void *)0)
(qual != ((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
193 )
(qual != ((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
&& (
(qual(r) == 0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
qual(r) == 0)
(qual(r) == 0)Description
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-1
194 continue;
never executed: continue;
0
195 if ((
(k = lh_OPENSS...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
k = lh_OPENSSL_STRING_insert(idx, r)) !=
(k = lh_OPENSS...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
196 ((void *)0)
(k = lh_OPENSS...!= ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
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: return 0;
0;
never executed: return 0;
0
203 }-
204 if (lh_OPENSSL_STRING_retrieve(idx, r) ==
lh_OPENSSL_STR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
205 ((void *)0)
lh_OPENSSL_STR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-2
206 ) {-
207 db->error = 1;-
208 lh_OPENSSL_STRING_free(idx);-
209 return
never executed: return 0;
0;
never executed: return 0;
0
210 }-
211 }
executed 2 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
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: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 4 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
4
216}-
217-
218long 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 ((
(buf = BUF_MEM...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
buf = BUF_MEM_new()) ==
(buf = BUF_MEM...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
228 ((void *)0)
(buf = BUF_MEM...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
229 )-
230 goto
never executed: goto err;
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
i < nDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
4-5
234 pp = sk_OPENSSL_PSTRING_value(db->data, i);-
235-
236 l = 0;-
237 for (j = 0; j < nn
j < nnDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
5-30
238 if (pp[j] !=
pp[j] != ((void *)0)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-26
239 ((void *)0)
pp[j] != ((void *)0)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-26
240 )-
241 l += strlen(pp[j]);
executed 26 times by 1 test: l += strlen(pp[j]);
Executed by:
  • libcrypto.so.1.1
26
242 }
executed 30 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
30
243 if (!BUF_MEM_grow_clean(buf, (int)(l * 2 + nn))
!BUF_MEM_grow_...)(l * 2 + nn))Description
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
244 goto
never executed: goto err;
err;
never executed: goto err;
0
245-
246 p = buf->data;-
247 for (j = 0; j < nn
j < nnDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; j++) {
5-30
248 f = pp[j];-
249 if (f !=
f != ((void *)0)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-26
250 ((void *)0)
f != ((void *)0)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-26
251 )-
252 for (;;) {-
253 if (*
*f == '\0'Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
f == '\0'
*f == '\0'Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 3103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
26-3103
254 break;
executed 26 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
26
255 if (*
*f == '\t'Description
TRUEnever evaluated
FALSEevaluated 3103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
f == '\t'
*f == '\t'Description
TRUEnever evaluated
FALSEevaluated 3103 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
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:
  • libcrypto.so.1.1
3103
259 *(p++) = '\t';-
260 }
executed 30 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
30
261 p[-1] = '\n';-
262 j = p - buf->data;-
263 if (BIO_write(out, buf->data, (int)j) != j
BIO_write(out,..., (int)j) != jDescription
TRUEnever evaluated
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-5
264 goto
never executed: goto err;
err;
never executed: goto err;
0
265 tot += j;-
266 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5
267 ret = tot;-
268 err:
code before this statement executed 4 times by 1 test: err:
Executed by:
  • libcrypto.so.1.1
4
269 BUF_MEM_free(buf);-
270 return
executed 4 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 4 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
4
271}-
272-
273int 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
i < db->num_fieldsDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
4-24
279 if (db->index[i] !=
db->index[i] != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-20
280 ((void *)0)
db->index[i] != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-20
281 ) {-
282 if ((
(db->qual[i] != ((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
db->qual[i] !=
(db->qual[i] != ((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
283 ((void *)0)
(db->qual[i] != ((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
284 )
(db->qual[i] != ((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
&& (
(db->qual[i] (row) == 0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
db->qual[i] (row) == 0)
(db->qual[i] (row) == 0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-2
285 continue;
never executed: continue;
0
286 r = lh_OPENSSL_STRING_retrieve(db->index[i], row);-
287 if (r !=
r != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
288 ((void *)0)
r != ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
289 ) {-
290 db->error = 2;-
291 db->arg1 = i;-
292 db->arg_row = r;-
293 goto
never executed: goto err;
err;
never executed: goto err;
0
294 }-
295 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
296 }
executed 24 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
24
297-
298 for (i = 0; i < db->num_fields
i < db->num_fieldsDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
4-24
299 if (db->index[i] !=
db->index[i] != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-20
300 ((void *)0)
db->index[i] != ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 20 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-20
301 ) {-
302 if ((
(db->qual[i] != ((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
db->qual[i] !=
(db->qual[i] != ((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
303 ((void *)0)
(db->qual[i] != ((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
304 )
(db->qual[i] != ((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
&& (
(db->qual[i] (row) == 0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
db->qual[i] (row) == 0)
(db->qual[i] (row) == 0)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
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) ==
lh_OPENSSL_STR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
308 ((void *)0)
lh_OPENSSL_STR...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-4
309 )-
310 goto
never executed: goto err1;
err1;
never executed: goto err1;
0
311 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4
312 }
executed 24 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
24
313 if (!sk_OPENSSL_PSTRING_push(db->data, row)
!sk_OPENSSL_PS...db->data, row)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-4
314 goto
never executed: goto err1;
err1;
never executed: goto err1;
0
315 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
316-
317 err1:-
318 db->error = 1;-
319 while (i-- > 0
i-- > 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
320 if (db->index[i] !=
db->index[i] != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
321 ((void *)0)
db->index[i] != ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
322 ) {-
323 if ((
(db->qual[i] != ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
db->qual[i] !=
(db->qual[i] != ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
324 ((void *)0)
(db->qual[i] != ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
0
325 )
(db->qual[i] != ((void *)0) )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(db->qual[i] (row) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
db->qual[i] (row) == 0)
(db->qual[i] (row) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
)
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: return 0;
0;
never executed: return 0;
0
332}-
333-
334void TXT_DB_free(TXT_DB *db)-
335{-
336 int i, n;-
337 char **p, *max;-
338-
339 if (db ==
db == ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-8
340 ((void *)0)
db == ((void *)0)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
2-8
341 )-
342 return;
executed 2 times by 1 test: return;
Executed by:
  • libcrypto.so.1.1
2
343 if (db->index !=
db->index != ((void *)0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-8
344 ((void *)0)
db->index != ((void *)0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-8
345 ) {-
346 for (i = db->num_fields - 1; i >= 0
i >= 0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--)
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:
  • libcrypto.so.1.1
48
348 CRYPTO_free(db->index, __FILE__, 292);-
349 }
executed 8 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8
350 CRYPTO_free(db->qual, __FILE__, 294);-
351 if (db->data !=
db->data != ((void *)0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-8
352 ((void *)0)
db->data != ((void *)0)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-8
353 ) {-
354 for (i = sk_OPENSSL_PSTRING_num(db->data) - 1; i >= 0
i >= 0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 8 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i--) {
8-9
355-
356-
357-
358-
359 p = sk_OPENSSL_PSTRING_value(db->data, i);-
360 max = p[db->num_fields];-
361 if (max ==
max == ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-5
362 ((void *)0)
max == ((void *)0)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
4-5
363 ) {-
364 for (n = 0; n < db->num_fields
n < db->num_fieldsDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; n++)
4-24
365 CRYPTO_free(p[n], __FILE__, 305);
executed 24 times by 1 test: CRYPTO_free(p[n], __FILE__, 305);
Executed by:
  • libcrypto.so.1.1
24
366 }
executed 4 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else {
4
367 for (n = 0; n < db->num_fields
n < db->num_fieldsDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 5 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; n++) {
5-30
368 if (((
(p[n] < (char *)p)Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p[n] < (char *)p)
(p[n] < (char *)p)Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(p[n] > max)Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
p[n] > max)
(p[n] > max)Description
TRUEnever evaluated
FALSEevaluated 30 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
))
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:
  • libcrypto.so.1.1
30
371 }
executed 5 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
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:
  • libcrypto.so.1.1
9
374 sk_OPENSSL_PSTRING_free(db->data);-
375 }
executed 8 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8
376 CRYPTO_free(db, __FILE__, 316);-
377}
executed 8 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
8
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2