Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/err/err_prn.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u), | - | ||||||||||||
6 | void *u) | - | ||||||||||||
7 | { | - | ||||||||||||
8 | unsigned long l; | - | ||||||||||||
9 | char buf[256]; | - | ||||||||||||
10 | char buf2[4096]; | - | ||||||||||||
11 | const char *file, *data; | - | ||||||||||||
12 | int line, flags; | - | ||||||||||||
13 | - | |||||||||||||
14 | - | |||||||||||||
15 | - | |||||||||||||
16 | - | |||||||||||||
17 | union { | - | ||||||||||||
18 | CRYPTO_THREAD_ID tid; | - | ||||||||||||
19 | unsigned long ltid; | - | ||||||||||||
20 | } tid; | - | ||||||||||||
21 | - | |||||||||||||
22 | tid.ltid = 0; | - | ||||||||||||
23 | tid.tid = CRYPTO_THREAD_get_current_id(); | - | ||||||||||||
24 | - | |||||||||||||
25 | while ((
| 3978-5917 | ||||||||||||
26 | ERR_error_string_n(l, buf, sizeof(buf)); | - | ||||||||||||
27 | BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", tid.ltid, buf, | - | ||||||||||||
28 | file, line, (flags & 0x02) ? data : ""); | - | ||||||||||||
29 | if (cb(buf2, strlen(buf2), u) <= 0
| 0-3978 | ||||||||||||
30 | break; never executed: break; | 0 | ||||||||||||
31 | } executed 3978 times by 1 test: end of block Executed by:
| 3978 | ||||||||||||
32 | } executed 5917 times by 1 test: end of block Executed by:
| 5917 | ||||||||||||
33 | - | |||||||||||||
34 | static int print_bio(const char *str, size_t len, void *bp) | - | ||||||||||||
35 | { | - | ||||||||||||
36 | return executed 3978 times by 1 test: BIO_write((BIO *)bp, str, len);return BIO_write((BIO *)bp, str, len); Executed by:
executed 3978 times by 1 test: return BIO_write((BIO *)bp, str, len); Executed by:
| 3978 | ||||||||||||
37 | } | - | ||||||||||||
38 | - | |||||||||||||
39 | void ERR_print_errors(BIO *bp) | - | ||||||||||||
40 | { | - | ||||||||||||
41 | ERR_print_errors_cb(print_bio, bp); | - | ||||||||||||
42 | } executed 2311 times by 1 test: end of block Executed by:
| 2311 | ||||||||||||
43 | - | |||||||||||||
44 | - | |||||||||||||
45 | void ERR_print_errors_fp(FILE *fp) | - | ||||||||||||
46 | { | - | ||||||||||||
47 | BIO *bio = BIO_new_fp(fp, 0x00); | - | ||||||||||||
48 | if (bio ==
| 0-3602 | ||||||||||||
49 | ((void *)0)
| 0-3602 | ||||||||||||
50 | ) | - | ||||||||||||
51 | return; never executed: return; | 0 | ||||||||||||
52 | - | |||||||||||||
53 | ERR_print_errors_cb(print_bio, bio); | - | ||||||||||||
54 | BIO_free(bio); | - | ||||||||||||
55 | } executed 3602 times by 1 test: end of block Executed by:
| 3602 | ||||||||||||
Switch to Source code | Preprocessed file |