OpenCoverage

bss_mem.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bio/bss_mem.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static int mem_write(BIO *h, const char *buf, int num);-
4static int mem_read(BIO *h, char *buf, int size);-
5static int mem_puts(BIO *h, const char *str);-
6static int mem_gets(BIO *h, char *str, int size);-
7static long mem_ctrl(BIO *h, int cmd, long arg1, void *arg2);-
8static int mem_new(BIO *h);-
9static int secmem_new(BIO *h);-
10static int mem_free(BIO *data);-
11static int mem_buf_free(BIO *data, int free_all);-
12static int mem_buf_sync(BIO *h);-
13-
14static const BIO_METHOD mem_method = {-
15 ( 1|0x0400),-
16 "memory buffer",-
17-
18 bwrite_conv,-
19 mem_write,-
20-
21 bread_conv,-
22 mem_read,-
23 mem_puts,-
24 mem_gets,-
25 mem_ctrl,-
26 mem_new,-
27 mem_free,-
28 -
29 ((void *)0)-
30 ,-
31};-
32-
33static const BIO_METHOD secmem_method = {-
34 ( 1|0x0400),-
35 "secure memory buffer",-
36-
37 bwrite_conv,-
38 mem_write,-
39-
40 bread_conv,-
41 mem_read,-
42 mem_puts,-
43 mem_gets,-
44 mem_ctrl,-
45 secmem_new,-
46 mem_free,-
47 -
48 ((void *)0)-
49 ,-
50};-
51-
52-
53typedef struct bio_buf_mem_st {-
54 struct buf_mem_st *buf;-
55 struct buf_mem_st *readp;-
56} BIO_BUF_MEM;-
57-
58-
59-
60-
61-
62-
63const BIO_METHOD *BIO_s_mem(void)-
64{-
65 return
executed 81666 times by 1 test: return &mem_method;
Executed by:
  • libcrypto.so.1.1
&mem_method;
executed 81666 times by 1 test: return &mem_method;
Executed by:
  • libcrypto.so.1.1
81666
66}-
67-
68const BIO_METHOD *BIO_s_secmem(void)-
69{-
70 return
executed 7726 times by 1 test: return(&secmem_method);
Executed by:
  • libcrypto.so.1.1
(&secmem_method);
executed 7726 times by 1 test: return(&secmem_method);
Executed by:
  • libcrypto.so.1.1
7726
71}-
72-
73BIO *BIO_new_mem_buf(const void *buf, int len)-
74{-
75 BIO *ret;-
76 BUF_MEM *b;-
77 BIO_BUF_MEM *bb;-
78 size_t sz;-
79-
80 if (buf ==
buf == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-37022
81 ((void *)0)
buf == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-37022
82 ) {-
83 ERR_put_error(32,(126),(115),__FILE__,89);-
84 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
85 ((void *)0)
never executed: return ((void *)0) ;
0
86 ;
never executed: return ((void *)0) ;
0
87 }-
88 sz = (
(len < 0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
len < 0)
(len < 0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
? strlen(buf) : (size_t)len;
0-37022
89 if ((
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret = BIO_new(BIO_s_mem())) ==
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-37022
90 ((void *)0)
(ret = BIO_new...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 37022 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-37022
91 )-
92 return
never executed: return ((void *)0) ;
never executed: return ((void *)0) ;
0
93 ((void *)0)
never executed: return ((void *)0) ;
0
94 ;
never executed: return ((void *)0) ;
0
95 bb = (BIO_BUF_MEM *)ret->ptr;-
96 b = bb->buf;-
97-
98 b->data = (void *)buf;-
99 b->length = sz;-
100 b->max = sz;-
101 *bb->readp = *bb->buf;-
102 ret->flags |= 0x200;-
103-
104 ret->num = 0;-
105 return
executed 37022 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 37022 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
37022
106}-
107-
108static int mem_init(BIO *bi, unsigned long flags)-
109{-
110 BIO_BUF_MEM *bb = CRYPTO_zalloc(sizeof(*bb), __FILE__, 110);-
111-
112 if (bb ==
bb == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
113 ((void *)0)
bb == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
114 )-
115 return
never executed: return 0;
0;
never executed: return 0;
0
116 if ((
(bb->buf = BUF...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bb->buf = BUF_MEM_new_ex(flags)) ==
(bb->buf = BUF...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
117 ((void *)0)
(bb->buf = BUF...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
118 ) {-
119 CRYPTO_free(bb, __FILE__, 115);-
120 return
never executed: return 0;
0;
never executed: return 0;
0
121 }-
122 if ((
(bb->readp = C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
bb->readp = CRYPTO_zalloc(sizeof(*bb->readp), __FILE__, 118)) ==
(bb->readp = C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
123 ((void *)0)
(bb->readp = C...== ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
124 ) {-
125 BUF_MEM_free(bb->buf);-
126 CRYPTO_free(bb, __FILE__, 120);-
127 return
never executed: return 0;
0;
never executed: return 0;
0
128 }-
129 *bb->readp = *bb->buf;-
130 bi->shutdown = 1;-
131 bi->init = 1;-
132 bi->num = -1;-
133 bi->ptr = (char *)bb;-
134 return
executed 111695 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 111695 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
111695
135}-
136-
137static int mem_new(BIO *bi)-
138{-
139 return
executed 96243 times by 1 test: return mem_init(bi, 0L);
Executed by:
  • libcrypto.so.1.1
mem_init(bi, 0L);
executed 96243 times by 1 test: return mem_init(bi, 0L);
Executed by:
  • libcrypto.so.1.1
96243
140}-
141-
142static int secmem_new(BIO *bi)-
143{-
144 return
executed 15452 times by 1 test: return mem_init(bi, 0x01);
Executed by:
  • libcrypto.so.1.1
mem_init(bi, 0x01);
executed 15452 times by 1 test: return mem_init(bi, 0x01);
Executed by:
  • libcrypto.so.1.1
15452
145}-
146-
147static int mem_free(BIO *a)-
148{-
149 return
executed 111695 times by 1 test: return mem_buf_free(a, 1);
Executed by:
  • libcrypto.so.1.1
mem_buf_free(a, 1);
executed 111695 times by 1 test: return mem_buf_free(a, 1);
Executed by:
  • libcrypto.so.1.1
111695
150}-
151-
152static int mem_buf_free(BIO *a, int free_all)-
153{-
154 if (a ==
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
155 ((void *)0)
a == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-111695
156 )-
157 return
never executed: return 0;
0;
never executed: return 0;
0
158-
159 if (a->shutdown
a->shutdownDescription
TRUEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& a->init
a->initDescription
TRUEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& a->ptr !=
a->ptr != ((void *)0)Description
TRUEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-111695
160 ((void *)0)
a->ptr != ((void *)0)Description
TRUEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-111695
161 ) {-
162 BIO_BUF_MEM *bb = (BIO_BUF_MEM *)a->ptr;-
163 BUF_MEM *b = bb->buf;-
164-
165 if (a->flags & 0x200
a->flags & 0x200Description
TRUEevaluated 37039 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 74656 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
37039-74656
166 b->data =
executed 37039 times by 1 test: b->data = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
37039
167 ((void *)0)
executed 37039 times by 1 test: b->data = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
37039
168 ;
executed 37039 times by 1 test: b->data = ((void *)0) ;
Executed by:
  • libcrypto.so.1.1
37039
169 BUF_MEM_free(b);-
170 if (free_all
free_allDescription
TRUEevaluated 111695 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-111695
171 CRYPTO_free(bb->readp, __FILE__, 159);-
172 CRYPTO_free(bb, __FILE__, 160);-
173 }
executed 111695 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
111695
174 a->ptr = -
175 ((void *)0)-
176 ;-
177 }
executed 111695 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
111695
178 return
executed 111695 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 111695 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
111695
179}-
180-
181-
182-
183-
184static int mem_buf_sync(BIO *b)-
185{-
186 if (b !=
b != ((void *)0)Description
TRUEevaluated 346472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-346472
187 ((void *)0)
b != ((void *)0)Description
TRUEevaluated 346472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-346472
188 && b->init != 0
b->init != 0Description
TRUEevaluated 346472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& b->ptr !=
b->ptr != ((void *)0)Description
TRUEevaluated 346472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-346472
189 ((void *)0)
b->ptr != ((void *)0)Description
TRUEevaluated 346472 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-346472
190 ) {-
191 BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;-
192-
193 if (bbm->readp->data != bbm->buf->data
bbm->readp->da...bbm->buf->dataDescription
TRUEevaluated 7781 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 338691 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
7781-338691
194 memmove(bbm->buf->data, bbm->readp->data, bbm->readp->length);-
195 bbm->buf->length = bbm->readp->length;-
196 bbm->readp->data = bbm->buf->data;-
197 }
executed 7781 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
7781
198 }
executed 346472 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
346472
199 return
executed 346472 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 346472 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
346472
200}-
201-
202static int mem_read(BIO *b, char *out, int outl)-
203{-
204 int ret = -1;-
205 BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;-
206 BUF_MEM *bm = bbm->readp;-
207-
208 BIO_clear_flags(b, ((0x01|0x02|0x04)|0x08));-
209 ret = (outl >= 0
outl >= 0Description
TRUEevaluated 929320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(size_t)outl > bm->lengthDescription
TRUEevaluated 87666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 841654 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
size_t)outl > bm->length
(size_t)outl > bm->lengthDescription
TRUEevaluated 87666 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 841654 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) ? (int)bm->length : outl;
0-929320
210 if ((
(out != ((void *)0) )Description
TRUEevaluated 929320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
out !=
(out != ((void *)0) )Description
TRUEevaluated 929320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-929320
211 ((void *)0)
(out != ((void *)0) )Description
TRUEevaluated 929320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-929320
212 )
(out != ((void *)0) )Description
TRUEevaluated 929320 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
&& (
(ret > 0)Description
TRUEevaluated 862038 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 67282 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ret > 0)
(ret > 0)Description
TRUEevaluated 862038 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 67282 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-929320
213 memcpy(out, bm->data, ret);-
214 bm->length -= ret;-
215 bm->data += ret;-
216 }
executed 862038 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
else if (bm->length == 0
bm->length == 0Description
TRUEevaluated 67282 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
) {
0-862038
217 ret = b->num;-
218 if (ret != 0
ret != 0Description
TRUEevaluated 30279 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 37003 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
30279-37003
219 BIO_set_flags(b, (0x01|0x08));
executed 30279 times by 1 test: BIO_set_flags(b, (0x01|0x08));
Executed by:
  • libcrypto.so.1.1
30279
220 }
executed 67282 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
67282
221 return
executed 929320 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 929320 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
929320
222}-
223-
224static int mem_write(BIO *b, const char *in, int inl)-
225{-
226 int ret = -1;-
227 int blen;-
228 BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;-
229-
230 if (in ==
in == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 328234 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-328234
231 ((void *)0)
in == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 328234 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-328234
232 ) {-
233 ERR_put_error(32,(117),(115),__FILE__,211);-
234 goto
never executed: goto end;
end;
never executed: goto end;
0
235 }-
236 if (b->flags & 0x200
b->flags & 0x200Description
TRUEnever evaluated
FALSEevaluated 328234 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-328234
237 ERR_put_error(32,(117),(126),__FILE__,215);-
238 goto
never executed: goto end;
end;
never executed: goto end;
0
239 }-
240 BIO_clear_flags(b, ((0x01|0x02|0x04)|0x08));-
241 if (inl == 0
inl == 0Description
TRUEnever evaluated
FALSEevaluated 328234 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-328234
242 return
never executed: return 0;
0;
never executed: return 0;
0
243 blen = bbm->readp->length;-
244 mem_buf_sync(b);-
245 if (BUF_MEM_grow_clean(bbm->buf, blen + inl) == 0
BUF_MEM_grow_c...en + inl) == 0Description
TRUEnever evaluated
FALSEevaluated 328234 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
0-328234
246 goto
never executed: goto end;
end;
never executed: goto end;
0
247 memcpy(bbm->buf->data + blen, in, inl);-
248 *bbm->readp = *bbm->buf;-
249 ret = inl;-
250 end:
code before this statement executed 328234 times by 1 test: end:
Executed by:
  • libcrypto.so.1.1
328234
251 return
executed 328234 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 328234 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
328234
252}-
253-
254static long mem_ctrl(BIO *b, int cmd, long num, void *ptr)-
255{-
256 long ret = 1;-
257 char **pptr;-
258 BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)b->ptr;-
259 BUF_MEM *bm;-
260-
261 switch (cmd) {-
262 case
executed 1974 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1:
executed 1974 times by 1 test: case 1:
Executed by:
  • libcrypto.so.1.1
1974
263 bm = bbm->buf;-
264 if (bm->data !=
bm->data != ((void *)0)Description
TRUEevaluated 1968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
6-1968
265 ((void *)0)
bm->data != ((void *)0)Description
TRUEevaluated 1968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 6 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
6-1968
266 ) {-
267-
268 if ((
(b->flags & 0x200)Description
TRUEnever evaluated
FALSEevaluated 1968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b->flags & 0x200)
(b->flags & 0x200)Description
TRUEnever evaluated
FALSEevaluated 1968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
|| (
(b->flags & 0x400)Description
TRUEnever evaluated
FALSEevaluated 1968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
b->flags & 0x400)
(b->flags & 0x400)Description
TRUEnever evaluated
FALSEevaluated 1968 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
0-1968
269 bm->length = bm->max;-
270 }
never executed: end of block
else {
0
271 memset(bm->data, 0, bm->max);-
272 bm->length = 0;-
273 }
executed 1968 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1968
274 *bbm->readp = *bbm->buf;-
275 }
executed 1968 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
1968
276 break;
executed 1974 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1974
277 case
never executed: case 2:
2:
never executed: case 2:
0
278 bm = bbm->readp;-
279 ret = (long)(bm->length == 0);-
280 break;
never executed: break;
0
281 case
executed 927 times by 1 test: case 130:
Executed by:
  • libcrypto.so.1.1
130:
executed 927 times by 1 test: case 130:
Executed by:
  • libcrypto.so.1.1
927
282 b->num = (int)num;-
283 break;
executed 927 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
927
284 case
executed 23655 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
3:
executed 23655 times by 1 test: case 3:
Executed by:
  • libcrypto.so.1.1
23655
285 bm = bbm->readp;-
286 ret = (long)bm->length;-
287 if (ptr !=
ptr != ((void *)0)Description
TRUEevaluated 5424 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18231 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5424-18231
288 ((void *)0)
ptr != ((void *)0)Description
TRUEevaluated 5424 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 18231 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
5424-18231
289 ) {-
290 pptr = (char **)ptr;-
291 *pptr = (char *)&(bm->data[0]);-
292 }
executed 5424 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
5424
293 break;
executed 23655 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
23655
294 case
never executed: case 114:
114:
never executed: case 114:
0
295 mem_buf_free(b, 0);-
296 b->shutdown = (int)num;-
297 bbm->buf = ptr;-
298 *bbm->readp = *bbm->buf;-
299 b->ptr = bbm;-
300 break;
never executed: break;
0
301 case
executed 18238 times by 1 test: case 115:
Executed by:
  • libcrypto.so.1.1
115:
executed 18238 times by 1 test: case 115:
Executed by:
  • libcrypto.so.1.1
18238
302 if (ptr !=
ptr != ((void *)0)Description
TRUEevaluated 18238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-18238
303 ((void *)0)
ptr != ((void *)0)Description
TRUEevaluated 18238 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-18238
304 ) {-
305 mem_buf_sync(b);-
306 bm = bbm->readp;-
307 pptr = (char **)ptr;-
308 *pptr = (char *)bm;-
309 }
executed 18238 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
18238
310 break;
executed 18238 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
18238
311 case
never executed: case 8:
8:
never executed: case 8:
0
312 ret = (long)b->shutdown;-
313 break;
never executed: break;
0
314 case
executed 9057 times by 1 test: case 9:
Executed by:
  • libcrypto.so.1.1
9:
executed 9057 times by 1 test: case 9:
Executed by:
  • libcrypto.so.1.1
9057
315 b->shutdown = (int)num;-
316 break;
executed 9057 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
9057
317 case
executed 483 times by 1 test: case 13:
Executed by:
  • libcrypto.so.1.1
13:
executed 483 times by 1 test: case 13:
Executed by:
  • libcrypto.so.1.1
483
318 ret = 0L;-
319 break;
executed 483 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
483
320 case
executed 1564 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
10:
executed 1564 times by 1 test: case 10:
Executed by:
  • libcrypto.so.1.1
1564
321 bm = bbm->readp;-
322 ret = (long)bm->length;-
323 break;
executed 1564 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
1564
324 case
never executed: case 12:
12:
never executed: case 12:
0
325 case
executed 17065 times by 1 test: case 11:
Executed by:
  • libcrypto.so.1.1
11:
executed 17065 times by 1 test: case 11:
Executed by:
  • libcrypto.so.1.1
17065
326 ret = 1;-
327 break;
executed 17065 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
17065
328 case
executed 45670 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
6:
executed 45670 times by 1 test: case 6:
Executed by:
  • libcrypto.so.1.1
45670
329 case
executed 8620 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
7:
executed 8620 times by 1 test: case 7:
Executed by:
  • libcrypto.so.1.1
8620
330 default
executed 7648 times by 1 test: default:
Executed by:
  • libcrypto.so.1.1
:
executed 7648 times by 1 test: default:
Executed by:
  • libcrypto.so.1.1
7648
331 ret = 0;-
332 break;
executed 61938 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
61938
333 }-
334 return
executed 134901 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 134901 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
134901
335}-
336-
337static int mem_gets(BIO *bp, char *buf, int size)-
338{-
339 int i, j;-
340 int ret = -1;-
341 char *p;-
342 BIO_BUF_MEM *bbm = (BIO_BUF_MEM *)bp->ptr;-
343 BUF_MEM *bm = bbm->readp;-
344-
345 BIO_clear_flags(bp, ((0x01|0x02|0x04)|0x08));-
346 j = bm->length;-
347 if ((
(size - 1) < jDescription
TRUEevaluated 73714 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 57017 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
size - 1) < j
(size - 1) < jDescription
TRUEevaluated 73714 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 57017 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
)
57017-73714
348 j = size - 1;
executed 73714 times by 1 test: j = size - 1;
Executed by:
  • libcrypto.so.1.1
73714
349 if (j <= 0
j <= 0Description
TRUEevaluated 591 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 130140 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
591-130140
350 *buf = '\0';-
351 return
executed 591 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 591 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
591
352 }-
353 p = bm->data;-
354 for (i = 0; i < j
i < jDescription
TRUEevaluated 5014074 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 402 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
; i++) {
402-5014074
355 if (p[i] == '\n'
p[i] == '\n'Description
TRUEevaluated 129738 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 4884336 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
) {
129738-4884336
356 i++;-
357 break;
executed 129738 times by 1 test: break;
Executed by:
  • libcrypto.so.1.1
129738
358 }-
359 }
executed 4884336 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
4884336
360-
361-
362-
363-
364-
365-
366 i = mem_read(bp, buf, i);-
367 if (i > 0
i > 0Description
TRUEevaluated 130140 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
)
0-130140
368 buf[i] = '\0';
executed 130140 times by 1 test: buf[i] = '\0';
Executed by:
  • libcrypto.so.1.1
130140
369 ret = i;-
370 return
executed 130140 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 130140 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
130140
371}-
372-
373static int mem_puts(BIO *bp, const char *str)-
374{-
375 int n, ret;-
376-
377 n = strlen(str);-
378 ret = mem_write(bp, str, n);-
379-
380 return
executed 263329 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
ret;
executed 263329 times by 1 test: return ret;
Executed by:
  • libcrypto.so.1.1
263329
381}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2