Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/crypto/err/err.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | - | |||||||||||||||||||
4 | - | |||||||||||||||||||
5 | struct lhash_st_ERR_STRING_DATA { int dummy; }; | - | ||||||||||||||||||
6 | struct lhash_st_ERR_STATE { int dummy; }; | - | ||||||||||||||||||
7 | - | |||||||||||||||||||
8 | static void err_load_strings(int lib, ERR_STRING_DATA *str); | - | ||||||||||||||||||
9 | - | |||||||||||||||||||
10 | static void ERR_STATE_free(ERR_STATE *s); | - | ||||||||||||||||||
11 | - | |||||||||||||||||||
12 | static ERR_STRING_DATA ERR_str_libraries[] = { | - | ||||||||||||||||||
13 | {(((((unsigned long)1)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "unknown library"}, | - | ||||||||||||||||||
14 | {(((((unsigned long)2)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "system library"}, | - | ||||||||||||||||||
15 | {(((((unsigned long)3)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "bignum routines"}, | - | ||||||||||||||||||
16 | {(((((unsigned long)4)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "rsa routines"}, | - | ||||||||||||||||||
17 | {(((((unsigned long)5)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "Diffie-Hellman routines"}, | - | ||||||||||||||||||
18 | {(((((unsigned long)6)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "digital envelope routines"}, | - | ||||||||||||||||||
19 | {(((((unsigned long)7)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "memory buffer routines"}, | - | ||||||||||||||||||
20 | {(((((unsigned long)8)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "object identifier routines"}, | - | ||||||||||||||||||
21 | {(((((unsigned long)9)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "PEM routines"}, | - | ||||||||||||||||||
22 | {(((((unsigned long)10)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "dsa routines"}, | - | ||||||||||||||||||
23 | {(((((unsigned long)11)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "x509 certificate routines"}, | - | ||||||||||||||||||
24 | {(((((unsigned long)13)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "asn1 encoding routines"}, | - | ||||||||||||||||||
25 | {(((((unsigned long)14)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "configuration file routines"}, | - | ||||||||||||||||||
26 | {(((((unsigned long)15)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "common libcrypto routines"}, | - | ||||||||||||||||||
27 | {(((((unsigned long)16)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "elliptic curve routines"}, | - | ||||||||||||||||||
28 | {(((((unsigned long)20)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "SSL routines"}, | - | ||||||||||||||||||
29 | {(((((unsigned long)32)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "BIO routines"}, | - | ||||||||||||||||||
30 | {(((((unsigned long)33)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "PKCS7 routines"}, | - | ||||||||||||||||||
31 | {(((((unsigned long)34)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "X509 V3 routines"}, | - | ||||||||||||||||||
32 | {(((((unsigned long)35)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "PKCS12 routines"}, | - | ||||||||||||||||||
33 | {(((((unsigned long)36)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "random number generator"}, | - | ||||||||||||||||||
34 | {(((((unsigned long)37)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "DSO support routines"}, | - | ||||||||||||||||||
35 | {(((((unsigned long)47)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "time stamp routines"}, | - | ||||||||||||||||||
36 | {(((((unsigned long)38)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "engine routines"}, | - | ||||||||||||||||||
37 | {(((((unsigned long)39)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "OCSP routines"}, | - | ||||||||||||||||||
38 | {(((((unsigned long)45)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "FIPS routines"}, | - | ||||||||||||||||||
39 | {(((((unsigned long)46)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "CMS routines"}, | - | ||||||||||||||||||
40 | {(((((unsigned long)48)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "HMAC routines"}, | - | ||||||||||||||||||
41 | {(((((unsigned long)50)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "GOST routines"}, | - | ||||||||||||||||||
42 | {0, | - | ||||||||||||||||||
43 | ((void *)0) | - | ||||||||||||||||||
44 | }, | - | ||||||||||||||||||
45 | }; | - | ||||||||||||||||||
46 | - | |||||||||||||||||||
47 | static ERR_STRING_DATA ERR_str_functs[] = { | - | ||||||||||||||||||
48 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)1)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "fopen"}, | - | ||||||||||||||||||
49 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)2)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "connect"}, | - | ||||||||||||||||||
50 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)3)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "getservbyname"}, | - | ||||||||||||||||||
51 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)4)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "socket"}, | - | ||||||||||||||||||
52 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)5)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "ioctl"}, | - | ||||||||||||||||||
53 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)6)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "bind"}, | - | ||||||||||||||||||
54 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)7)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "listen"}, | - | ||||||||||||||||||
55 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)8)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "accept"}, | - | ||||||||||||||||||
56 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)10)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "opendir"}, | - | ||||||||||||||||||
57 | {(((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)11)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))), "fread"}, | - | ||||||||||||||||||
58 | {0, | - | ||||||||||||||||||
59 | ((void *)0) | - | ||||||||||||||||||
60 | }, | - | ||||||||||||||||||
61 | }; | - | ||||||||||||||||||
62 | - | |||||||||||||||||||
63 | static ERR_STRING_DATA ERR_str_reasons[] = { | - | ||||||||||||||||||
64 | {2, "system lib"}, | - | ||||||||||||||||||
65 | {3, "BN lib"}, | - | ||||||||||||||||||
66 | {4, "RSA lib"}, | - | ||||||||||||||||||
67 | {5, "DH lib"}, | - | ||||||||||||||||||
68 | {6, "EVP lib"}, | - | ||||||||||||||||||
69 | {7, "BUF lib"}, | - | ||||||||||||||||||
70 | {8, "OBJ lib"}, | - | ||||||||||||||||||
71 | {9, "PEM lib"}, | - | ||||||||||||||||||
72 | {10, "DSA lib"}, | - | ||||||||||||||||||
73 | {11, "X509 lib"}, | - | ||||||||||||||||||
74 | {13, "ASN1 lib"}, | - | ||||||||||||||||||
75 | {14, "CONF lib"}, | - | ||||||||||||||||||
76 | {15, "CRYPTO lib"}, | - | ||||||||||||||||||
77 | {16, "EC lib"}, | - | ||||||||||||||||||
78 | {20, "SSL lib"}, | - | ||||||||||||||||||
79 | {32, "BIO lib"}, | - | ||||||||||||||||||
80 | {33, "PKCS7 lib"}, | - | ||||||||||||||||||
81 | {34, "X509V3 lib"}, | - | ||||||||||||||||||
82 | {35, "PKCS12 lib"}, | - | ||||||||||||||||||
83 | {36, "RAND lib"}, | - | ||||||||||||||||||
84 | {37, "DSO lib"}, | - | ||||||||||||||||||
85 | {38, "ENGINE lib"}, | - | ||||||||||||||||||
86 | {39, "OCSP lib"}, | - | ||||||||||||||||||
87 | {47, "TS lib"}, | - | ||||||||||||||||||
88 | - | |||||||||||||||||||
89 | {58, "nested asn1 error"}, | - | ||||||||||||||||||
90 | {59, "bad asn1 object header"}, | - | ||||||||||||||||||
91 | {60, "bad get asn1 object call"}, | - | ||||||||||||||||||
92 | {61, "expecting an asn1 sequence"}, | - | ||||||||||||||||||
93 | {62, "asn1 length mismatch"}, | - | ||||||||||||||||||
94 | {63, "missing asn1 eos"}, | - | ||||||||||||||||||
95 | - | |||||||||||||||||||
96 | {64, "fatal"}, | - | ||||||||||||||||||
97 | {(1|64), "malloc failure"}, | - | ||||||||||||||||||
98 | {(2|64), "called a function you should not call"}, | - | ||||||||||||||||||
99 | {(3|64), "passed a null parameter"}, | - | ||||||||||||||||||
100 | {(4|64), "internal error"}, | - | ||||||||||||||||||
101 | {(5|64) , "called a function that was disabled at compile-time"}, | - | ||||||||||||||||||
102 | - | |||||||||||||||||||
103 | {0, | - | ||||||||||||||||||
104 | ((void *)0) | - | ||||||||||||||||||
105 | }, | - | ||||||||||||||||||
106 | }; | - | ||||||||||||||||||
107 | - | |||||||||||||||||||
108 | - | |||||||||||||||||||
109 | - | |||||||||||||||||||
110 | - | |||||||||||||||||||
111 | struct st_ERR_FNS { | - | ||||||||||||||||||
112 | - | |||||||||||||||||||
113 | struct lhash_st_ERR_STRING_DATA *(*cb_err_get)(int create); | - | ||||||||||||||||||
114 | void (*cb_err_del)(void); | - | ||||||||||||||||||
115 | ERR_STRING_DATA *(*cb_err_get_item)(const ERR_STRING_DATA *); | - | ||||||||||||||||||
116 | ERR_STRING_DATA *(*cb_err_set_item)(ERR_STRING_DATA *); | - | ||||||||||||||||||
117 | ERR_STRING_DATA *(*cb_err_del_item)(ERR_STRING_DATA *); | - | ||||||||||||||||||
118 | - | |||||||||||||||||||
119 | struct lhash_st_ERR_STATE *(*cb_thread_get)(int create); | - | ||||||||||||||||||
120 | void (*cb_thread_release)(struct lhash_st_ERR_STATE **hash); | - | ||||||||||||||||||
121 | ERR_STATE *(*cb_thread_get_item)(const ERR_STATE *); | - | ||||||||||||||||||
122 | ERR_STATE *(*cb_thread_set_item)(ERR_STATE *); | - | ||||||||||||||||||
123 | void (*cb_thread_del_item)(const ERR_STATE *); | - | ||||||||||||||||||
124 | - | |||||||||||||||||||
125 | int (*cb_get_next_lib)(void); | - | ||||||||||||||||||
126 | }; | - | ||||||||||||||||||
127 | - | |||||||||||||||||||
128 | - | |||||||||||||||||||
129 | static struct lhash_st_ERR_STRING_DATA *int_err_get(int create); | - | ||||||||||||||||||
130 | static void int_err_del(void); | - | ||||||||||||||||||
131 | static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *); | - | ||||||||||||||||||
132 | static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *); | - | ||||||||||||||||||
133 | static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *); | - | ||||||||||||||||||
134 | static struct lhash_st_ERR_STATE *int_thread_get(int create); | - | ||||||||||||||||||
135 | static void int_thread_release(struct lhash_st_ERR_STATE **hash); | - | ||||||||||||||||||
136 | static ERR_STATE *int_thread_get_item(const ERR_STATE *); | - | ||||||||||||||||||
137 | static ERR_STATE *int_thread_set_item(ERR_STATE *); | - | ||||||||||||||||||
138 | static void int_thread_del_item(const ERR_STATE *); | - | ||||||||||||||||||
139 | static int int_err_get_next_lib(void); | - | ||||||||||||||||||
140 | - | |||||||||||||||||||
141 | - | |||||||||||||||||||
142 | static const ERR_FNS err_defaults = { | - | ||||||||||||||||||
143 | int_err_get, | - | ||||||||||||||||||
144 | int_err_del, | - | ||||||||||||||||||
145 | int_err_get_item, | - | ||||||||||||||||||
146 | int_err_set_item, | - | ||||||||||||||||||
147 | int_err_del_item, | - | ||||||||||||||||||
148 | int_thread_get, | - | ||||||||||||||||||
149 | int_thread_release, | - | ||||||||||||||||||
150 | int_thread_get_item, | - | ||||||||||||||||||
151 | int_thread_set_item, | - | ||||||||||||||||||
152 | int_thread_del_item, | - | ||||||||||||||||||
153 | int_err_get_next_lib | - | ||||||||||||||||||
154 | }; | - | ||||||||||||||||||
155 | - | |||||||||||||||||||
156 | - | |||||||||||||||||||
157 | static const ERR_FNS *err_fns = | - | ||||||||||||||||||
158 | ((void *)0) | - | ||||||||||||||||||
159 | ; | - | ||||||||||||||||||
160 | static struct lhash_st_ERR_STRING_DATA *int_error_hash = | - | ||||||||||||||||||
161 | ((void *)0) | - | ||||||||||||||||||
162 | ; | - | ||||||||||||||||||
163 | static struct lhash_st_ERR_STATE *int_thread_hash = | - | ||||||||||||||||||
164 | ((void *)0) | - | ||||||||||||||||||
165 | ; | - | ||||||||||||||||||
166 | static int int_thread_hash_references = 0; | - | ||||||||||||||||||
167 | static int int_err_library_number = 128; | - | ||||||||||||||||||
168 | - | |||||||||||||||||||
169 | static pthread_t err_init_thread; | - | ||||||||||||||||||
170 | - | |||||||||||||||||||
171 | - | |||||||||||||||||||
172 | - | |||||||||||||||||||
173 | static void | - | ||||||||||||||||||
174 | err_fns_check(void) | - | ||||||||||||||||||
175 | { | - | ||||||||||||||||||
176 | if (err_fns
| 292-468227 | ||||||||||||||||||
177 | return; executed 468227 times by 33 tests: return; Executed by:
| 468227 | ||||||||||||||||||
178 | - | |||||||||||||||||||
179 | CRYPTO_lock(1|8,1,__FILE__,296); | - | ||||||||||||||||||
180 | if (!err_fns
| 0-292 | ||||||||||||||||||
181 | err_fns = &err_defaults; executed 292 times by 33 tests: err_fns = &err_defaults; Executed by:
| 292 | ||||||||||||||||||
182 | CRYPTO_lock(2|8,1,__FILE__,299); | - | ||||||||||||||||||
183 | } executed 292 times by 33 tests: end of block Executed by:
| 292 | ||||||||||||||||||
184 | - | |||||||||||||||||||
185 | - | |||||||||||||||||||
186 | - | |||||||||||||||||||
187 | const ERR_FNS * | - | ||||||||||||||||||
188 | ERR_get_implementation(void) | - | ||||||||||||||||||
189 | { | - | ||||||||||||||||||
190 | err_fns_check(); | - | ||||||||||||||||||
191 | return never executed: err_fns;return err_fns; never executed: return err_fns; | 0 | ||||||||||||||||||
192 | } | - | ||||||||||||||||||
193 | - | |||||||||||||||||||
194 | int | - | ||||||||||||||||||
195 | ERR_set_implementation(const ERR_FNS *fns) | - | ||||||||||||||||||
196 | { | - | ||||||||||||||||||
197 | int ret = 0; | - | ||||||||||||||||||
198 | - | |||||||||||||||||||
199 | CRYPTO_lock(1|8,1,__FILE__,316); | - | ||||||||||||||||||
200 | - | |||||||||||||||||||
201 | - | |||||||||||||||||||
202 | if (!err_fns
| 0 | ||||||||||||||||||
203 | err_fns = fns; | - | ||||||||||||||||||
204 | ret = 1; | - | ||||||||||||||||||
205 | } never executed: end of block | 0 | ||||||||||||||||||
206 | CRYPTO_lock(2|8,1,__FILE__,323); | - | ||||||||||||||||||
207 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||
208 | } | - | ||||||||||||||||||
209 | - | |||||||||||||||||||
210 | - | |||||||||||||||||||
211 | - | |||||||||||||||||||
212 | - | |||||||||||||||||||
213 | static unsigned long get_error_values(int inc, int top, const char **file, | - | ||||||||||||||||||
214 | int *line, const char **data, int *flags); | - | ||||||||||||||||||
215 | - | |||||||||||||||||||
216 | - | |||||||||||||||||||
217 | - | |||||||||||||||||||
218 | static unsigned long | - | ||||||||||||||||||
219 | err_string_data_hash(const ERR_STRING_DATA *a) | - | ||||||||||||||||||
220 | { | - | ||||||||||||||||||
221 | unsigned long ret, l; | - | ||||||||||||||||||
222 | - | |||||||||||||||||||
223 | l = a->error; | - | ||||||||||||||||||
224 | ret = l^(int)((((unsigned long)l)>>24L)&0xffL)^(int)((((unsigned long)l)>>12L)&0xfffL); | - | ||||||||||||||||||
225 | return executed 440007 times by 31 tests: (ret^ret % 19*13);return (ret^ret % 19*13); Executed by:
executed 440007 times by 31 tests: return (ret^ret % 19*13); Executed by:
| 440007 | ||||||||||||||||||
226 | } | - | ||||||||||||||||||
227 | static unsigned long err_string_data_LHASH_HASH(const void *arg) { const ERR_STRING_DATA *a = arg; return executed 440007 times by 31 tests: err_string_data_hash(a);return err_string_data_hash(a); Executed by:
executed 440007 times by 31 tests: }return err_string_data_hash(a); Executed by:
| 440007 | ||||||||||||||||||
228 | - | |||||||||||||||||||
229 | static int | - | ||||||||||||||||||
230 | err_string_data_cmp(const ERR_STRING_DATA *a, const ERR_STRING_DATA *b) | - | ||||||||||||||||||
231 | { | - | ||||||||||||||||||
232 | return executed 23797 times by 31 tests: (int)(a->error - b->error);return (int)(a->error - b->error); Executed by:
executed 23797 times by 31 tests: return (int)(a->error - b->error); Executed by:
| 23797 | ||||||||||||||||||
233 | } | - | ||||||||||||||||||
234 | static int err_string_data_LHASH_COMP(const void *arg1, const void *arg2) { const ERR_STRING_DATA *a = arg1; const ERR_STRING_DATA *b = arg2; return executed 23797 times by 31 tests: err_string_data_cmp(a,b);return err_string_data_cmp(a,b); Executed by:
executed 23797 times by 31 tests: }return err_string_data_cmp(a,b); Executed by:
| 23797 | ||||||||||||||||||
235 | - | |||||||||||||||||||
236 | static | - | ||||||||||||||||||
237 | struct lhash_st_ERR_STRING_DATA *int_err_get(int create) | - | ||||||||||||||||||
238 | { | - | ||||||||||||||||||
239 | struct lhash_st_ERR_STRING_DATA *ret = | - | ||||||||||||||||||
240 | ((void *)0) | - | ||||||||||||||||||
241 | ; | - | ||||||||||||||||||
242 | - | |||||||||||||||||||
243 | CRYPTO_lock(1|8,1,__FILE__,358); | - | ||||||||||||||||||
244 | if (!int_error_hash
| 1-439717 | ||||||||||||||||||
245 | CRYPTO_push_info_("int_err_get (err.c)", __FILE__, 360);; | - | ||||||||||||||||||
246 | int_error_hash = ((struct lhash_st_ERR_STRING_DATA *)lh_new(err_string_data_LHASH_HASH, err_string_data_LHASH_COMP)); | - | ||||||||||||||||||
247 | CRYPTO_pop_info(); | - | ||||||||||||||||||
248 | } executed 290 times by 31 tests: end of block Executed by:
| 290 | ||||||||||||||||||
249 | if (int_error_hash
| 1-440007 | ||||||||||||||||||
250 | ret = int_error_hash; executed 440007 times by 31 tests: ret = int_error_hash; Executed by:
| 440007 | ||||||||||||||||||
251 | CRYPTO_lock(2|8,1,__FILE__,366); | - | ||||||||||||||||||
252 | - | |||||||||||||||||||
253 | return executed 440008 times by 31 tests: ret;return ret; Executed by:
executed 440008 times by 31 tests: return ret; Executed by:
| 440008 | ||||||||||||||||||
254 | } | - | ||||||||||||||||||
255 | - | |||||||||||||||||||
256 | static void | - | ||||||||||||||||||
257 | int_err_del(void) | - | ||||||||||||||||||
258 | { | - | ||||||||||||||||||
259 | CRYPTO_lock(1|8,1,__FILE__,374); | - | ||||||||||||||||||
260 | if (int_error_hash
| 0-267 | ||||||||||||||||||
261 | lh_free(((_LHASH *)((void*) (1 ? int_error_hash : (struct lhash_st_ERR_STRING_DATA*)0)))); | - | ||||||||||||||||||
262 | int_error_hash = | - | ||||||||||||||||||
263 | ((void *)0) | - | ||||||||||||||||||
264 | ; | - | ||||||||||||||||||
265 | } executed 267 times by 8 tests: end of block Executed by:
| 267 | ||||||||||||||||||
266 | CRYPTO_lock(2|8,1,__FILE__,379); | - | ||||||||||||||||||
267 | } executed 267 times by 8 tests: end of block Executed by:
| 267 | ||||||||||||||||||
268 | - | |||||||||||||||||||
269 | static ERR_STRING_DATA * | - | ||||||||||||||||||
270 | int_err_get_item(const ERR_STRING_DATA *d) | - | ||||||||||||||||||
271 | { | - | ||||||||||||||||||
272 | ERR_STRING_DATA *p; | - | ||||||||||||||||||
273 | struct lhash_st_ERR_STRING_DATA *hash; | - | ||||||||||||||||||
274 | - | |||||||||||||||||||
275 | err_fns_check(); | - | ||||||||||||||||||
276 | hash = err_fns->cb_err_get(0); | - | ||||||||||||||||||
277 | if (!hash
| 1-7868 | ||||||||||||||||||
278 | return executed 1 time by 1 test: return ((void *)0) ; Executed by:
executed 1 time by 1 test: return ((void *)0) ; Executed by:
| 1 | ||||||||||||||||||
279 | ((void *)0) executed 1 time by 1 test: return ((void *)0) ; Executed by:
| 1 | ||||||||||||||||||
280 | ; executed 1 time by 1 test: return ((void *)0) ; Executed by:
| 1 | ||||||||||||||||||
281 | - | |||||||||||||||||||
282 | CRYPTO_lock(1|4,1,__FILE__,393); | - | ||||||||||||||||||
283 | p = ((ERR_STRING_DATA *)lh_retrieve(((_LHASH *)((void*) (1 ? hash : (struct lhash_st_ERR_STRING_DATA*)0))), ((void*) (1 ? d : (ERR_STRING_DATA*)0)))); | - | ||||||||||||||||||
284 | CRYPTO_lock(2|4,1,__FILE__,395); | - | ||||||||||||||||||
285 | - | |||||||||||||||||||
286 | return executed 7868 times by 31 tests: p;return p; Executed by:
executed 7868 times by 31 tests: return p; Executed by:
| 7868 | ||||||||||||||||||
287 | } | - | ||||||||||||||||||
288 | - | |||||||||||||||||||
289 | static ERR_STRING_DATA * | - | ||||||||||||||||||
290 | int_err_set_item(ERR_STRING_DATA *d) | - | ||||||||||||||||||
291 | { | - | ||||||||||||||||||
292 | ERR_STRING_DATA *p; | - | ||||||||||||||||||
293 | struct lhash_st_ERR_STRING_DATA *hash; | - | ||||||||||||||||||
294 | - | |||||||||||||||||||
295 | err_fns_check(); | - | ||||||||||||||||||
296 | hash = err_fns->cb_err_get(1); | - | ||||||||||||||||||
297 | if (!hash
| 0-432139 | ||||||||||||||||||
298 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
299 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
300 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
301 | - | |||||||||||||||||||
302 | CRYPTO_lock(1|8,1,__FILE__,411); | - | ||||||||||||||||||
303 | p = ((ERR_STRING_DATA *)lh_insert(((_LHASH *)((void*) (1 ? hash : (struct lhash_st_ERR_STRING_DATA*)0))), ((void*) (1 ? d : (ERR_STRING_DATA*)0)))); | - | ||||||||||||||||||
304 | CRYPTO_lock(2|8,1,__FILE__,413); | - | ||||||||||||||||||
305 | - | |||||||||||||||||||
306 | return executed 432139 times by 31 tests: p;return p; Executed by:
executed 432139 times by 31 tests: return p; Executed by:
| 432139 | ||||||||||||||||||
307 | } | - | ||||||||||||||||||
308 | - | |||||||||||||||||||
309 | static ERR_STRING_DATA * | - | ||||||||||||||||||
310 | int_err_del_item(ERR_STRING_DATA *d) | - | ||||||||||||||||||
311 | { | - | ||||||||||||||||||
312 | ERR_STRING_DATA *p; | - | ||||||||||||||||||
313 | struct lhash_st_ERR_STRING_DATA *hash; | - | ||||||||||||||||||
314 | - | |||||||||||||||||||
315 | err_fns_check(); | - | ||||||||||||||||||
316 | hash = err_fns->cb_err_get(0); | - | ||||||||||||||||||
317 | if (!hash
| 0 | ||||||||||||||||||
318 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
319 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
320 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
321 | - | |||||||||||||||||||
322 | CRYPTO_lock(1|8,1,__FILE__,429); | - | ||||||||||||||||||
323 | p = ((ERR_STRING_DATA *)lh_delete(((_LHASH *)((void*) (1 ? hash : (struct lhash_st_ERR_STRING_DATA*)0))), ((void*) (1 ? d : (ERR_STRING_DATA*)0)))); | - | ||||||||||||||||||
324 | CRYPTO_lock(2|8,1,__FILE__,431); | - | ||||||||||||||||||
325 | - | |||||||||||||||||||
326 | return never executed: p;return p; never executed: return p; | 0 | ||||||||||||||||||
327 | } | - | ||||||||||||||||||
328 | - | |||||||||||||||||||
329 | static unsigned long | - | ||||||||||||||||||
330 | err_state_hash(const ERR_STATE *a) | - | ||||||||||||||||||
331 | { | - | ||||||||||||||||||
332 | return executed 10038 times by 20 tests: CRYPTO_THREADID_hash(&a->tid) * 13;return CRYPTO_THREADID_hash(&a->tid) * 13; Executed by:
executed 10038 times by 20 tests: return CRYPTO_THREADID_hash(&a->tid) * 13; Executed by:
| 10038 | ||||||||||||||||||
333 | } | - | ||||||||||||||||||
334 | static unsigned long err_state_LHASH_HASH(const void *arg) { const ERR_STATE *a = arg; return executed 10038 times by 20 tests: err_state_hash(a);return err_state_hash(a); Executed by:
executed 10038 times by 20 tests: }return err_state_hash(a); Executed by:
| 10038 | ||||||||||||||||||
335 | - | |||||||||||||||||||
336 | static int | - | ||||||||||||||||||
337 | err_state_cmp(const ERR_STATE *a, const ERR_STATE *b) | - | ||||||||||||||||||
338 | { | - | ||||||||||||||||||
339 | return executed 9759 times by 20 tests: CRYPTO_THREADID_cmp(&a->tid, &b->tid);return CRYPTO_THREADID_cmp(&a->tid, &b->tid); Executed by:
executed 9759 times by 20 tests: return CRYPTO_THREADID_cmp(&a->tid, &b->tid); Executed by:
| 9759 | ||||||||||||||||||
340 | } | - | ||||||||||||||||||
341 | static int err_state_LHASH_COMP(const void *arg1, const void *arg2) { const ERR_STATE *a = arg1; const ERR_STATE *b = arg2; return executed 9759 times by 20 tests: err_state_cmp(a,b);return err_state_cmp(a,b); Executed by:
executed 9759 times by 20 tests: }return err_state_cmp(a,b); Executed by:
| 9759 | ||||||||||||||||||
342 | - | |||||||||||||||||||
343 | static | - | ||||||||||||||||||
344 | struct lhash_st_ERR_STATE *int_thread_get(int create) | - | ||||||||||||||||||
345 | { | - | ||||||||||||||||||
346 | struct lhash_st_ERR_STATE *ret = | - | ||||||||||||||||||
347 | ((void *)0) | - | ||||||||||||||||||
348 | ; | - | ||||||||||||||||||
349 | - | |||||||||||||||||||
350 | CRYPTO_lock(1|8,1,__FILE__,455); | - | ||||||||||||||||||
351 | if (!int_thread_hash
| 279-9759 | ||||||||||||||||||
352 | CRYPTO_push_info_("int_thread_get (err.c)", __FILE__, 457);; | - | ||||||||||||||||||
353 | int_thread_hash = ((struct lhash_st_ERR_STATE *)lh_new(err_state_LHASH_HASH, err_state_LHASH_COMP)); | - | ||||||||||||||||||
354 | CRYPTO_pop_info(); | - | ||||||||||||||||||
355 | } executed 279 times by 20 tests: end of block Executed by:
| 279 | ||||||||||||||||||
356 | if (int_thread_hash
| 283-10038 | ||||||||||||||||||
357 | int_thread_hash_references++; | - | ||||||||||||||||||
358 | ret = int_thread_hash; | - | ||||||||||||||||||
359 | } executed 10038 times by 20 tests: end of block Executed by:
| 10038 | ||||||||||||||||||
360 | CRYPTO_lock(2|8,1,__FILE__,465); | - | ||||||||||||||||||
361 | return executed 10321 times by 24 tests: ret;return ret; Executed by:
executed 10321 times by 24 tests: return ret; Executed by:
| 10321 | ||||||||||||||||||
362 | } | - | ||||||||||||||||||
363 | - | |||||||||||||||||||
364 | static void | - | ||||||||||||||||||
365 | int_thread_release(struct lhash_st_ERR_STATE **hash) | - | ||||||||||||||||||
366 | { | - | ||||||||||||||||||
367 | int i; | - | ||||||||||||||||||
368 | - | |||||||||||||||||||
369 | if (hash ==
| 0-10038 | ||||||||||||||||||
370 | ((void *)0)
| 0-10038 | ||||||||||||||||||
371 | || *
| 0-10038 | ||||||||||||||||||
372 | ((void *)0)
| 0-10038 | ||||||||||||||||||
373 | ) | - | ||||||||||||||||||
374 | return; never executed: return; | 0 | ||||||||||||||||||
375 | - | |||||||||||||||||||
376 | i = CRYPTO_add_lock(&int_thread_hash_references,-1,1,__FILE__,477); | - | ||||||||||||||||||
377 | if (i > 0
| 0-10038 | ||||||||||||||||||
378 | return; never executed: return; | 0 | ||||||||||||||||||
379 | - | |||||||||||||||||||
380 | *hash = | - | ||||||||||||||||||
381 | ((void *)0) | - | ||||||||||||||||||
382 | ; | - | ||||||||||||||||||
383 | } executed 10038 times by 20 tests: end of block Executed by:
| 10038 | ||||||||||||||||||
384 | - | |||||||||||||||||||
385 | static ERR_STATE * | - | ||||||||||||||||||
386 | int_thread_get_item(const ERR_STATE *d) | - | ||||||||||||||||||
387 | { | - | ||||||||||||||||||
388 | ERR_STATE *p; | - | ||||||||||||||||||
389 | struct lhash_st_ERR_STATE *hash; | - | ||||||||||||||||||
390 | - | |||||||||||||||||||
391 | err_fns_check(); | - | ||||||||||||||||||
392 | hash = err_fns->cb_thread_get(0); | - | ||||||||||||||||||
393 | if (!hash
| 279-9494 | ||||||||||||||||||
394 | return executed 279 times by 20 tests: return ((void *)0) ; Executed by:
executed 279 times by 20 tests: return ((void *)0) ; Executed by:
| 279 | ||||||||||||||||||
395 | ((void *)0) executed 279 times by 20 tests: return ((void *)0) ; Executed by:
| 279 | ||||||||||||||||||
396 | ; executed 279 times by 20 tests: return ((void *)0) ; Executed by:
| 279 | ||||||||||||||||||
397 | - | |||||||||||||||||||
398 | CRYPTO_lock(1|4,1,__FILE__,495); | - | ||||||||||||||||||
399 | p = ((ERR_STATE *)lh_retrieve(((_LHASH *)((void*) (1 ? hash : (struct lhash_st_ERR_STATE*)0))), ((void*) (1 ? d : (ERR_STATE*)0)))); | - | ||||||||||||||||||
400 | CRYPTO_lock(2|4,1,__FILE__,497); | - | ||||||||||||||||||
401 | - | |||||||||||||||||||
402 | err_fns->cb_thread_release(&hash); | - | ||||||||||||||||||
403 | return executed 9494 times by 20 tests: p;return p; Executed by:
executed 9494 times by 20 tests: return p; Executed by:
| 9494 | ||||||||||||||||||
404 | } | - | ||||||||||||||||||
405 | - | |||||||||||||||||||
406 | static ERR_STATE * | - | ||||||||||||||||||
407 | int_thread_set_item(ERR_STATE *d) | - | ||||||||||||||||||
408 | { | - | ||||||||||||||||||
409 | ERR_STATE *p; | - | ||||||||||||||||||
410 | struct lhash_st_ERR_STATE *hash; | - | ||||||||||||||||||
411 | - | |||||||||||||||||||
412 | err_fns_check(); | - | ||||||||||||||||||
413 | hash = err_fns->cb_thread_get(1); | - | ||||||||||||||||||
414 | if (!hash
| 0-279 | ||||||||||||||||||
415 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
416 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
417 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
418 | - | |||||||||||||||||||
419 | CRYPTO_lock(1|8,1,__FILE__,514); | - | ||||||||||||||||||
420 | p = ((ERR_STATE *)lh_insert(((_LHASH *)((void*) (1 ? hash : (struct lhash_st_ERR_STATE*)0))), ((void*) (1 ? d : (ERR_STATE*)0)))); | - | ||||||||||||||||||
421 | CRYPTO_lock(2|8,1,__FILE__,516); | - | ||||||||||||||||||
422 | - | |||||||||||||||||||
423 | err_fns->cb_thread_release(&hash); | - | ||||||||||||||||||
424 | return executed 279 times by 20 tests: p;return p; Executed by:
executed 279 times by 20 tests: return p; Executed by:
| 279 | ||||||||||||||||||
425 | } | - | ||||||||||||||||||
426 | - | |||||||||||||||||||
427 | static void | - | ||||||||||||||||||
428 | int_thread_del_item(const ERR_STATE *d) | - | ||||||||||||||||||
429 | { | - | ||||||||||||||||||
430 | ERR_STATE *p; | - | ||||||||||||||||||
431 | struct lhash_st_ERR_STATE *hash; | - | ||||||||||||||||||
432 | - | |||||||||||||||||||
433 | err_fns_check(); | - | ||||||||||||||||||
434 | hash = err_fns->cb_thread_get(0); | - | ||||||||||||||||||
435 | if (!hash
| 4-265 | ||||||||||||||||||
436 | return; executed 4 times by 4 tests: return; Executed by:
| 4 | ||||||||||||||||||
437 | - | |||||||||||||||||||
438 | CRYPTO_lock(1|8,1,__FILE__,533); | - | ||||||||||||||||||
439 | p = ((ERR_STATE *)lh_delete(((_LHASH *)((void*) (1 ? hash : (struct lhash_st_ERR_STATE*)0))), ((void*) (1 ? d : (ERR_STATE*)0)))); | - | ||||||||||||||||||
440 | - | |||||||||||||||||||
441 | if (int_thread_hash_references == 1
| 0-265 | ||||||||||||||||||
442 | int_thread_hash
| 0-265 | ||||||||||||||||||
443 | lh_free(((_LHASH *)((void*) (1 ? int_thread_hash : (struct lhash_st_ERR_STATE*)0)))); | - | ||||||||||||||||||
444 | int_thread_hash = | - | ||||||||||||||||||
445 | ((void *)0) | - | ||||||||||||||||||
446 | ; | - | ||||||||||||||||||
447 | } executed 265 times by 6 tests: end of block Executed by:
| 265 | ||||||||||||||||||
448 | CRYPTO_lock(2|8,1,__FILE__,541); | - | ||||||||||||||||||
449 | - | |||||||||||||||||||
450 | err_fns->cb_thread_release(&hash); | - | ||||||||||||||||||
451 | if (p
| 0-265 | ||||||||||||||||||
452 | ERR_STATE_free(p); executed 265 times by 6 tests: ERR_STATE_free(p); Executed by:
| 265 | ||||||||||||||||||
453 | } executed 265 times by 6 tests: end of block Executed by:
| 265 | ||||||||||||||||||
454 | - | |||||||||||||||||||
455 | static int | - | ||||||||||||||||||
456 | int_err_get_next_lib(void) | - | ||||||||||||||||||
457 | { | - | ||||||||||||||||||
458 | int ret; | - | ||||||||||||||||||
459 | - | |||||||||||||||||||
460 | CRYPTO_lock(1|8,1,__FILE__,553); | - | ||||||||||||||||||
461 | ret = int_err_library_number++; | - | ||||||||||||||||||
462 | CRYPTO_lock(2|8,1,__FILE__,555); | - | ||||||||||||||||||
463 | - | |||||||||||||||||||
464 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||
465 | } | - | ||||||||||||||||||
466 | - | |||||||||||||||||||
467 | - | |||||||||||||||||||
468 | - | |||||||||||||||||||
469 | - | |||||||||||||||||||
470 | - | |||||||||||||||||||
471 | - | |||||||||||||||||||
472 | static ERR_STRING_DATA SYS_str_reasons[127 + 1]; | - | ||||||||||||||||||
473 | static void | - | ||||||||||||||||||
474 | build_SYS_str_reasons(void) | - | ||||||||||||||||||
475 | { | - | ||||||||||||||||||
476 | - | |||||||||||||||||||
477 | static char strerror_tab[127][32]; | - | ||||||||||||||||||
478 | int i; | - | ||||||||||||||||||
479 | static int init = 1; | - | ||||||||||||||||||
480 | - | |||||||||||||||||||
481 | CRYPTO_lock(1|4,1,__FILE__,583); | - | ||||||||||||||||||
482 | if (!init
| 1-290 | ||||||||||||||||||
483 | CRYPTO_lock(2|4,1,__FILE__,585); | - | ||||||||||||||||||
484 | return; executed 1 time by 1 test: return; Executed by:
| 1 | ||||||||||||||||||
485 | } | - | ||||||||||||||||||
486 | - | |||||||||||||||||||
487 | CRYPTO_lock(2|4,1,__FILE__,589); | - | ||||||||||||||||||
488 | CRYPTO_lock(1|8,1,__FILE__,590); | - | ||||||||||||||||||
489 | if (!init
| 0-290 | ||||||||||||||||||
490 | CRYPTO_lock(2|8,1,__FILE__,592); | - | ||||||||||||||||||
491 | return; never executed: return; | 0 | ||||||||||||||||||
492 | } | - | ||||||||||||||||||
493 | - | |||||||||||||||||||
494 | for (i = 1; i <= 127
| 290-36830 | ||||||||||||||||||
495 | ERR_STRING_DATA *str = &SYS_str_reasons[i - 1]; | - | ||||||||||||||||||
496 | - | |||||||||||||||||||
497 | str->error = (unsigned long)i; | - | ||||||||||||||||||
498 | if (str->string ==
| 0-36830 | ||||||||||||||||||
499 | ((void *)0)
| 0-36830 | ||||||||||||||||||
500 | ) { | - | ||||||||||||||||||
501 | char (*dest)[32] = | - | ||||||||||||||||||
502 | &(strerror_tab[i - 1]); | - | ||||||||||||||||||
503 | const char *src = strerror(i); | - | ||||||||||||||||||
504 | if (src !=
| 0-36830 | ||||||||||||||||||
505 | ((void *)0)
| 0-36830 | ||||||||||||||||||
506 | ) { | - | ||||||||||||||||||
507 | strlcpy(*dest, src, sizeof *dest); | - | ||||||||||||||||||
508 | str->string = *dest; | - | ||||||||||||||||||
509 | } executed 36830 times by 31 tests: end of block Executed by:
| 36830 | ||||||||||||||||||
510 | } executed 36830 times by 31 tests: end of block Executed by:
| 36830 | ||||||||||||||||||
511 | if (str->string ==
| 0-36830 | ||||||||||||||||||
512 | ((void *)0)
| 0-36830 | ||||||||||||||||||
513 | ) | - | ||||||||||||||||||
514 | str->string = "unknown"; never executed: str->string = "unknown"; | 0 | ||||||||||||||||||
515 | } executed 36830 times by 31 tests: end of block Executed by:
| 36830 | ||||||||||||||||||
516 | - | |||||||||||||||||||
517 | - | |||||||||||||||||||
518 | - | |||||||||||||||||||
519 | - | |||||||||||||||||||
520 | init = 0; | - | ||||||||||||||||||
521 | - | |||||||||||||||||||
522 | CRYPTO_lock(2|8,1,__FILE__,618); | - | ||||||||||||||||||
523 | } executed 290 times by 31 tests: end of block Executed by:
| 290 | ||||||||||||||||||
524 | static void | - | ||||||||||||||||||
525 | ERR_STATE_free(ERR_STATE *s) | - | ||||||||||||||||||
526 | { | - | ||||||||||||||||||
527 | int i; | - | ||||||||||||||||||
528 | - | |||||||||||||||||||
529 | if (s ==
| 0-265 | ||||||||||||||||||
530 | ((void *)0)
| 0-265 | ||||||||||||||||||
531 | ) | - | ||||||||||||||||||
532 | return; never executed: return; | 0 | ||||||||||||||||||
533 | - | |||||||||||||||||||
534 | for (i = 0; i < 16
| 265-4240 | ||||||||||||||||||
535 | do { if (((
| 0-4240 | ||||||||||||||||||
536 | ((void *)0)
| 0-4240 | ||||||||||||||||||
537 | )
| 0-4240 | ||||||||||||||||||
538 | ((void *)0) | - | ||||||||||||||||||
539 | ; } never executed: (s)->err_data_flags[i] = 0; } while(0);end of block | 0 | ||||||||||||||||||
540 | } executed 4240 times by 6 tests: end of block Executed by:
| 4240 | ||||||||||||||||||
541 | free(s); | - | ||||||||||||||||||
542 | } executed 265 times by 6 tests: end of block Executed by:
| 265 | ||||||||||||||||||
543 | - | |||||||||||||||||||
544 | void | - | ||||||||||||||||||
545 | ERR_load_ERR_strings_internal(void) | - | ||||||||||||||||||
546 | { | - | ||||||||||||||||||
547 | err_init_thread = pthread_self(); | - | ||||||||||||||||||
548 | err_fns_check(); | - | ||||||||||||||||||
549 | - | |||||||||||||||||||
550 | err_load_strings(0, ERR_str_libraries); | - | ||||||||||||||||||
551 | err_load_strings(0, ERR_str_reasons); | - | ||||||||||||||||||
552 | err_load_strings(2, ERR_str_functs); | - | ||||||||||||||||||
553 | build_SYS_str_reasons(); | - | ||||||||||||||||||
554 | err_load_strings(2, SYS_str_reasons); | - | ||||||||||||||||||
555 | - | |||||||||||||||||||
556 | } executed 291 times by 31 tests: end of block Executed by:
| 291 | ||||||||||||||||||
557 | - | |||||||||||||||||||
558 | - | |||||||||||||||||||
559 | void | - | ||||||||||||||||||
560 | ERR_load_ERR_strings(void) | - | ||||||||||||||||||
561 | { | - | ||||||||||||||||||
562 | static pthread_once_t once = | - | ||||||||||||||||||
563 | 0 | - | ||||||||||||||||||
564 | ; | - | ||||||||||||||||||
565 | - | |||||||||||||||||||
566 | if (pthread_equal(pthread_self(), err_init_thread)
| 1-15627 | ||||||||||||||||||
567 | return; executed 15627 times by 31 tests: return; Executed by:
| 15627 | ||||||||||||||||||
568 | - | |||||||||||||||||||
569 | - | |||||||||||||||||||
570 | (void) OPENSSL_init_crypto(0, | - | ||||||||||||||||||
571 | ((void *)0) | - | ||||||||||||||||||
572 | ); | - | ||||||||||||||||||
573 | - | |||||||||||||||||||
574 | (void) pthread_once(&once, ERR_load_ERR_strings_internal); | - | ||||||||||||||||||
575 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||||||||
576 | - | |||||||||||||||||||
577 | static void | - | ||||||||||||||||||
578 | err_load_strings(int lib, ERR_STRING_DATA *str) | - | ||||||||||||||||||
579 | { | - | ||||||||||||||||||
580 | while (str->error
| 16792-432139 | ||||||||||||||||||
581 | if (lib
| 39867-392272 | ||||||||||||||||||
582 | str->error |= (((((unsigned long)lib)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))); executed 39867 times by 31 tests: str->error |= (((((unsigned long)lib)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))); Executed by:
| 39867 | ||||||||||||||||||
583 | err_fns->cb_err_set_item(str); | - | ||||||||||||||||||
584 | str++; | - | ||||||||||||||||||
585 | } executed 432139 times by 31 tests: end of block Executed by:
| 432139 | ||||||||||||||||||
586 | } executed 16792 times by 31 tests: end of block Executed by:
| 16792 | ||||||||||||||||||
587 | - | |||||||||||||||||||
588 | void | - | ||||||||||||||||||
589 | ERR_load_strings(int lib, ERR_STRING_DATA *str) | - | ||||||||||||||||||
590 | { | - | ||||||||||||||||||
591 | ERR_load_ERR_strings(); | - | ||||||||||||||||||
592 | err_load_strings(lib, str); | - | ||||||||||||||||||
593 | } executed 15628 times by 31 tests: end of block Executed by:
| 15628 | ||||||||||||||||||
594 | - | |||||||||||||||||||
595 | void | - | ||||||||||||||||||
596 | ERR_unload_strings(int lib, ERR_STRING_DATA *str) | - | ||||||||||||||||||
597 | { | - | ||||||||||||||||||
598 | - | |||||||||||||||||||
599 | (void) OPENSSL_init_crypto(0, | - | ||||||||||||||||||
600 | ((void *)0) | - | ||||||||||||||||||
601 | ); | - | ||||||||||||||||||
602 | - | |||||||||||||||||||
603 | while (str->error
| 0 | ||||||||||||||||||
604 | if (lib
| 0 | ||||||||||||||||||
605 | str->error |= (((((unsigned long)lib)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))); never executed: str->error |= (((((unsigned long)lib)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))); | 0 | ||||||||||||||||||
606 | err_fns->cb_err_del_item(str); | - | ||||||||||||||||||
607 | str++; | - | ||||||||||||||||||
608 | } never executed: end of block | 0 | ||||||||||||||||||
609 | } never executed: end of block | 0 | ||||||||||||||||||
610 | - | |||||||||||||||||||
611 | void | - | ||||||||||||||||||
612 | ERR_free_strings(void) | - | ||||||||||||||||||
613 | { | - | ||||||||||||||||||
614 | - | |||||||||||||||||||
615 | (void) OPENSSL_init_crypto(0, | - | ||||||||||||||||||
616 | ((void *)0) | - | ||||||||||||||||||
617 | ); | - | ||||||||||||||||||
618 | - | |||||||||||||||||||
619 | err_fns_check(); | - | ||||||||||||||||||
620 | err_fns->cb_err_del(); | - | ||||||||||||||||||
621 | } executed 267 times by 8 tests: end of block Executed by:
| 267 | ||||||||||||||||||
622 | - | |||||||||||||||||||
623 | - | |||||||||||||||||||
624 | - | |||||||||||||||||||
625 | void | - | ||||||||||||||||||
626 | ERR_put_error(int lib, int func, int reason, const char *file, int line) | - | ||||||||||||||||||
627 | { | - | ||||||||||||||||||
628 | ERR_STATE *es; | - | ||||||||||||||||||
629 | int save_errno = | - | ||||||||||||||||||
630 | (*__errno_location ()) | - | ||||||||||||||||||
631 | ; | - | ||||||||||||||||||
632 | - | |||||||||||||||||||
633 | es = ERR_get_state(); | - | ||||||||||||||||||
634 | - | |||||||||||||||||||
635 | es->top = (es->top + 1) % 16; | - | ||||||||||||||||||
636 | if (es->top == es->bottom
| 1012-1276 | ||||||||||||||||||
637 | es->bottom = (es->bottom + 1) % 16; executed 1012 times by 2 tests: es->bottom = (es->bottom + 1) % 16; Executed by:
| 1012 | ||||||||||||||||||
638 | es->err_flags[es->top] = 0; | - | ||||||||||||||||||
639 | es->err_buffer[es->top] = (((((unsigned long)lib)&0xffL)<<24L)| ((((unsigned long)func)&0xfffL)<<12L)| ((((unsigned long)reason)&0xfffL))); | - | ||||||||||||||||||
640 | es->err_file[es->top] = file; | - | ||||||||||||||||||
641 | es->err_line[es->top] = line; | - | ||||||||||||||||||
642 | do { if (((
| 0-2288 | ||||||||||||||||||
643 | ((
| 0-2288 | ||||||||||||||||||
644 | )
| 0-2288 | ||||||||||||||||||
645 | ((void *)0) | - | ||||||||||||||||||
646 | ; } never executed: (es)->err_data_flags[es->top] = 0; } while(0);end of block | 0 | ||||||||||||||||||
647 | - | |||||||||||||||||||
648 | (*__errno_location ()) | - | ||||||||||||||||||
649 | = save_errno; | - | ||||||||||||||||||
650 | } executed 2288 times by 12 tests: end of block Executed by:
| 2288 | ||||||||||||||||||
651 | - | |||||||||||||||||||
652 | void | - | ||||||||||||||||||
653 | ERR_clear_error(void) | - | ||||||||||||||||||
654 | { | - | ||||||||||||||||||
655 | int i; | - | ||||||||||||||||||
656 | ERR_STATE *es; | - | ||||||||||||||||||
657 | - | |||||||||||||||||||
658 | es = ERR_get_state(); | - | ||||||||||||||||||
659 | - | |||||||||||||||||||
660 | for (i = 0; i < 16
| 3196-51136 | ||||||||||||||||||
661 | do { (es)->err_flags[i] = 0; (es)->err_buffer[i] = 0; do { if (((
| 359-50777 | ||||||||||||||||||
662 | ((void *)0)
| 359-50777 | ||||||||||||||||||
663 | )
| 0-50777 | ||||||||||||||||||
664 | ((void *)0) | - | ||||||||||||||||||
665 | ; } executed 359 times by 4 tests: (es)->err_data_flags[i] = 0; } while(0); (es)->err_file[i] = end of block Executed by:
| 359 | ||||||||||||||||||
666 | ((void *)0) | - | ||||||||||||||||||
667 | ; (es)->err_line[i] = -1; } while(0); | - | ||||||||||||||||||
668 | } executed 51136 times by 10 tests: end of block Executed by:
| 51136 | ||||||||||||||||||
669 | es->top = es->bottom = 0; | - | ||||||||||||||||||
670 | } executed 3196 times by 10 tests: end of block Executed by:
| 3196 | ||||||||||||||||||
671 | - | |||||||||||||||||||
672 | - | |||||||||||||||||||
673 | unsigned long | - | ||||||||||||||||||
674 | ERR_get_error(void) | - | ||||||||||||||||||
675 | { | - | ||||||||||||||||||
676 | return never executed: (get_error_values(1, 0, return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
677 | ((void *)0) never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
678 | , never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
679 | ((void *)0) never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
680 | , never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
681 | ((void *)0) never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
682 | , never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
683 | ((void *)0) never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
684 | )); never executed: return (get_error_values(1, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
685 | } | - | ||||||||||||||||||
686 | - | |||||||||||||||||||
687 | unsigned long | - | ||||||||||||||||||
688 | ERR_get_error_line(const char **file, int *line) | - | ||||||||||||||||||
689 | { | - | ||||||||||||||||||
690 | return never executed: (get_error_values(1, 0, file, line, return (get_error_values(1, 0, file, line, ((void *)0) , ((void *)0) )); never executed: return (get_error_values(1, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
691 | ((void *)0) never executed: return (get_error_values(1, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
692 | , never executed: return (get_error_values(1, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
693 | ((void *)0) never executed: return (get_error_values(1, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
694 | )); never executed: return (get_error_values(1, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
695 | } | - | ||||||||||||||||||
696 | - | |||||||||||||||||||
697 | unsigned long | - | ||||||||||||||||||
698 | ERR_get_error_line_data(const char **file, int *line, | - | ||||||||||||||||||
699 | const char **data, int *flags) | - | ||||||||||||||||||
700 | { | - | ||||||||||||||||||
701 | return executed 285 times by 6 tests: (get_error_values(1, 0, file, line, data, flags));return (get_error_values(1, 0, file, line, data, flags)); Executed by:
executed 285 times by 6 tests: return (get_error_values(1, 0, file, line, data, flags)); Executed by:
| 285 | ||||||||||||||||||
702 | } | - | ||||||||||||||||||
703 | - | |||||||||||||||||||
704 | - | |||||||||||||||||||
705 | unsigned long | - | ||||||||||||||||||
706 | ERR_peek_error(void) | - | ||||||||||||||||||
707 | { | - | ||||||||||||||||||
708 | return executed 2916 times by 2 tests: (get_error_values(0, 0, return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
709 | ((void *)0) executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
710 | , executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
711 | ((void *)0) executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
712 | , executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
713 | ((void *)0) executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
714 | , executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
715 | ((void *)0) executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
716 | )); executed 2916 times by 2 tests: return (get_error_values(0, 0, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 2916 | ||||||||||||||||||
717 | } | - | ||||||||||||||||||
718 | - | |||||||||||||||||||
719 | unsigned long | - | ||||||||||||||||||
720 | ERR_peek_error_line(const char **file, int *line) | - | ||||||||||||||||||
721 | { | - | ||||||||||||||||||
722 | return never executed: (get_error_values(0, 0, file, line, return (get_error_values(0, 0, file, line, ((void *)0) , ((void *)0) )); never executed: return (get_error_values(0, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
723 | ((void *)0) never executed: return (get_error_values(0, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
724 | , never executed: return (get_error_values(0, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
725 | ((void *)0) never executed: return (get_error_values(0, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
726 | )); never executed: return (get_error_values(0, 0, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
727 | } | - | ||||||||||||||||||
728 | - | |||||||||||||||||||
729 | unsigned long | - | ||||||||||||||||||
730 | ERR_peek_error_line_data(const char **file, int *line, | - | ||||||||||||||||||
731 | const char **data, int *flags) | - | ||||||||||||||||||
732 | { | - | ||||||||||||||||||
733 | return never executed: (get_error_values(0, 0, file, line, data, flags));return (get_error_values(0, 0, file, line, data, flags)); never executed: return (get_error_values(0, 0, file, line, data, flags)); | 0 | ||||||||||||||||||
734 | } | - | ||||||||||||||||||
735 | - | |||||||||||||||||||
736 | unsigned long | - | ||||||||||||||||||
737 | ERR_peek_last_error(void) | - | ||||||||||||||||||
738 | { | - | ||||||||||||||||||
739 | return executed 450 times by 3 tests: (get_error_values(0, 1, return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
740 | ((void *)0) executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
741 | , executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
742 | ((void *)0) executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
743 | , executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
744 | ((void *)0) executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
745 | , executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
746 | ((void *)0) executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
747 | )); executed 450 times by 3 tests: return (get_error_values(0, 1, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) )); Executed by:
| 450 | ||||||||||||||||||
748 | } | - | ||||||||||||||||||
749 | - | |||||||||||||||||||
750 | unsigned long | - | ||||||||||||||||||
751 | ERR_peek_last_error_line(const char **file, int *line) | - | ||||||||||||||||||
752 | { | - | ||||||||||||||||||
753 | return never executed: (get_error_values(0, 1, file, line, return (get_error_values(0, 1, file, line, ((void *)0) , ((void *)0) )); never executed: return (get_error_values(0, 1, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
754 | ((void *)0) never executed: return (get_error_values(0, 1, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
755 | , never executed: return (get_error_values(0, 1, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
756 | ((void *)0) never executed: return (get_error_values(0, 1, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
757 | )); never executed: return (get_error_values(0, 1, file, line, ((void *)0) , ((void *)0) )); | 0 | ||||||||||||||||||
758 | } | - | ||||||||||||||||||
759 | - | |||||||||||||||||||
760 | unsigned long | - | ||||||||||||||||||
761 | ERR_peek_last_error_line_data(const char **file, int *line, | - | ||||||||||||||||||
762 | const char **data, int *flags) | - | ||||||||||||||||||
763 | { | - | ||||||||||||||||||
764 | return never executed: (get_error_values(0, 1, file, line, data, flags));return (get_error_values(0, 1, file, line, data, flags)); never executed: return (get_error_values(0, 1, file, line, data, flags)); | 0 | ||||||||||||||||||
765 | } | - | ||||||||||||||||||
766 | - | |||||||||||||||||||
767 | static unsigned long | - | ||||||||||||||||||
768 | get_error_values(int inc, int top, const char **file, int *line, | - | ||||||||||||||||||
769 | const char **data, int *flags) | - | ||||||||||||||||||
770 | { | - | ||||||||||||||||||
771 | int i = 0; | - | ||||||||||||||||||
772 | ERR_STATE *es; | - | ||||||||||||||||||
773 | unsigned long ret; | - | ||||||||||||||||||
774 | - | |||||||||||||||||||
775 | es = ERR_get_state(); | - | ||||||||||||||||||
776 | - | |||||||||||||||||||
777 | if (inc
| 0-3366 | ||||||||||||||||||
778 | if (file
| 0 | ||||||||||||||||||
779 | * never executed: file = "";*file = ""; never executed: *file = ""; | 0 | ||||||||||||||||||
780 | if (line
| 0 | ||||||||||||||||||
781 | * never executed: line = 0;*line = 0; never executed: *line = 0; | 0 | ||||||||||||||||||
782 | if (data
| 0 | ||||||||||||||||||
783 | * never executed: data = "";*data = ""; never executed: *data = ""; | 0 | ||||||||||||||||||
784 | if (flags
| 0 | ||||||||||||||||||
785 | * never executed: flags = 0;*flags = 0; never executed: *flags = 0; | 0 | ||||||||||||||||||
786 | - | |||||||||||||||||||
787 | return never executed: (4|64);return (4|64); never executed: return (4|64); | 0 | ||||||||||||||||||
788 | } | - | ||||||||||||||||||
789 | - | |||||||||||||||||||
790 | if (es->bottom == es->top
| 454-3197 | ||||||||||||||||||
791 | return executed 3197 times by 7 tests: 0;return 0; Executed by:
executed 3197 times by 7 tests: return 0; Executed by:
| 3197 | ||||||||||||||||||
792 | if (top
| 4-450 | ||||||||||||||||||
793 | i = es->top; executed 450 times by 3 tests: i = es->top; Executed by:
| 450 | ||||||||||||||||||
794 | else | - | ||||||||||||||||||
795 | i = (es->bottom + 1) % 16; executed 4 times by 1 test: i = (es->bottom + 1) % 16; Executed by:
| 4 | ||||||||||||||||||
796 | - | |||||||||||||||||||
797 | ret = es->err_buffer[i]; | - | ||||||||||||||||||
798 | if (inc
| 0-454 | ||||||||||||||||||
799 | es->bottom = i; | - | ||||||||||||||||||
800 | es->err_buffer[i] = 0; | - | ||||||||||||||||||
801 | } never executed: end of block | 0 | ||||||||||||||||||
802 | - | |||||||||||||||||||
803 | if ((
| 0-454 | ||||||||||||||||||
804 | ((void *)0)
| 0-454 | ||||||||||||||||||
805 | )
| 0-454 | ||||||||||||||||||
806 | ((void *)0)
| 0 | ||||||||||||||||||
807 | )
| 0 | ||||||||||||||||||
808 | if (es->err_file[i] ==
| 0 | ||||||||||||||||||
809 | ((void *)0)
| 0 | ||||||||||||||||||
810 | ) { | - | ||||||||||||||||||
811 | *file = "NA"; | - | ||||||||||||||||||
812 | if (line !=
| 0 | ||||||||||||||||||
813 | ((void *)0)
| 0 | ||||||||||||||||||
814 | ) | - | ||||||||||||||||||
815 | * never executed: line = 0;*line = 0; never executed: *line = 0; | 0 | ||||||||||||||||||
816 | } never executed: else {end of block | 0 | ||||||||||||||||||
817 | *file = es->err_file[i]; | - | ||||||||||||||||||
818 | if (line !=
| 0 | ||||||||||||||||||
819 | ((void *)0)
| 0 | ||||||||||||||||||
820 | ) | - | ||||||||||||||||||
821 | * never executed: line = es->err_line[i];*line = es->err_line[i]; never executed: *line = es->err_line[i]; | 0 | ||||||||||||||||||
822 | } never executed: end of block | 0 | ||||||||||||||||||
823 | } | - | ||||||||||||||||||
824 | - | |||||||||||||||||||
825 | if (data ==
| 0-454 | ||||||||||||||||||
826 | ((void *)0)
| 0-454 | ||||||||||||||||||
827 | ) { | - | ||||||||||||||||||
828 | if (inc
| 0-454 | ||||||||||||||||||
829 | do { if (((
| 0 | ||||||||||||||||||
830 | ((void *)0)
| 0 | ||||||||||||||||||
831 | )
| 0 | ||||||||||||||||||
832 | ((void *)0) | - | ||||||||||||||||||
833 | ; } never executed: (es)->err_data_flags[i] = 0; } while(0);end of block | 0 | ||||||||||||||||||
834 | } never executed: end of block | 0 | ||||||||||||||||||
835 | } executed 454 times by 3 tests: else {end of block Executed by:
| 454 | ||||||||||||||||||
836 | if (es->err_data[i] ==
| 0 | ||||||||||||||||||
837 | ((void *)0)
| 0 | ||||||||||||||||||
838 | ) { | - | ||||||||||||||||||
839 | *data = ""; | - | ||||||||||||||||||
840 | if (flags !=
| 0 | ||||||||||||||||||
841 | ((void *)0)
| 0 | ||||||||||||||||||
842 | ) | - | ||||||||||||||||||
843 | * never executed: flags = 0;*flags = 0; never executed: *flags = 0; | 0 | ||||||||||||||||||
844 | } never executed: else {end of block | 0 | ||||||||||||||||||
845 | *data = es->err_data[i]; | - | ||||||||||||||||||
846 | if (flags !=
| 0 | ||||||||||||||||||
847 | ((void *)0)
| 0 | ||||||||||||||||||
848 | ) | - | ||||||||||||||||||
849 | * never executed: flags = es->err_data_flags[i];*flags = es->err_data_flags[i]; never executed: *flags = es->err_data_flags[i]; | 0 | ||||||||||||||||||
850 | } never executed: end of block | 0 | ||||||||||||||||||
851 | } | - | ||||||||||||||||||
852 | return executed 454 times by 3 tests: ret;return ret; Executed by:
executed 454 times by 3 tests: return ret; Executed by:
| 454 | ||||||||||||||||||
853 | } | - | ||||||||||||||||||
854 | - | |||||||||||||||||||
855 | void | - | ||||||||||||||||||
856 | ERR_error_string_n(unsigned long e, char *buf, size_t len) | - | ||||||||||||||||||
857 | { | - | ||||||||||||||||||
858 | char lsbuf[30], fsbuf[30], rsbuf[30]; | - | ||||||||||||||||||
859 | const char *ls, *fs, *rs; | - | ||||||||||||||||||
860 | int l, f, r, ret; | - | ||||||||||||||||||
861 | - | |||||||||||||||||||
862 | l = (int)((((unsigned long)e)>>24L)&0xffL); | - | ||||||||||||||||||
863 | f = (int)((((unsigned long)e)>>12L)&0xfffL); | - | ||||||||||||||||||
864 | r = (int)((e)&0xfffL); | - | ||||||||||||||||||
865 | - | |||||||||||||||||||
866 | ls = ERR_lib_error_string(e); | - | ||||||||||||||||||
867 | fs = ERR_func_error_string(e); | - | ||||||||||||||||||
868 | rs = ERR_reason_error_string(e); | - | ||||||||||||||||||
869 | - | |||||||||||||||||||
870 | if (ls ==
| 0 | ||||||||||||||||||
871 | ((void *)0)
| 0 | ||||||||||||||||||
872 | ) { | - | ||||||||||||||||||
873 | (void) snprintf(lsbuf, sizeof(lsbuf), "lib(%d)", l); | - | ||||||||||||||||||
874 | ls = lsbuf; | - | ||||||||||||||||||
875 | } never executed: end of block | 0 | ||||||||||||||||||
876 | if (fs ==
| 0 | ||||||||||||||||||
877 | ((void *)0)
| 0 | ||||||||||||||||||
878 | ) { | - | ||||||||||||||||||
879 | (void) snprintf(fsbuf, sizeof(fsbuf), "func(%d)", f); | - | ||||||||||||||||||
880 | fs = fsbuf; | - | ||||||||||||||||||
881 | } never executed: end of block | 0 | ||||||||||||||||||
882 | if (rs ==
| 0 | ||||||||||||||||||
883 | ((void *)0)
| 0 | ||||||||||||||||||
884 | ) { | - | ||||||||||||||||||
885 | (void) snprintf(rsbuf, sizeof(rsbuf), "reason(%d)", r); | - | ||||||||||||||||||
886 | rs = rsbuf; | - | ||||||||||||||||||
887 | } never executed: end of block | 0 | ||||||||||||||||||
888 | - | |||||||||||||||||||
889 | ret = snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls, fs, rs); | - | ||||||||||||||||||
890 | if (ret == -1
| 0 | ||||||||||||||||||
891 | return; never executed: return; | 0 | ||||||||||||||||||
892 | if (ret >= len
| 0 | ||||||||||||||||||
893 | - | |||||||||||||||||||
894 | - | |||||||||||||||||||
895 | - | |||||||||||||||||||
896 | if (len > 4
| 0 | ||||||||||||||||||
897 | { | - | ||||||||||||||||||
898 | int i; | - | ||||||||||||||||||
899 | char *s = buf; | - | ||||||||||||||||||
900 | - | |||||||||||||||||||
901 | for (i = 0; i < 4
| 0 | ||||||||||||||||||
902 | char *colon = | - | ||||||||||||||||||
903 | (__extension__ (__builtin_constant_p (
| 0 | ||||||||||||||||||
904 | ':'
| 0 | ||||||||||||||||||
905 | )
| 0 | ||||||||||||||||||
906 | s
| 0 | ||||||||||||||||||
907 | )
| 0 | ||||||||||||||||||
908 | ':'
| 0 | ||||||||||||||||||
909 | ) == '\0'
| 0 | ||||||||||||||||||
910 | s | - | ||||||||||||||||||
911 | , | - | ||||||||||||||||||
912 | ':' | - | ||||||||||||||||||
913 | ) : __builtin_strchr ( | - | ||||||||||||||||||
914 | s | - | ||||||||||||||||||
915 | , | - | ||||||||||||||||||
916 | ':' | - | ||||||||||||||||||
917 | ))) | - | ||||||||||||||||||
918 | ; | - | ||||||||||||||||||
919 | if (colon ==
| 0 | ||||||||||||||||||
920 | ((void *)0)
| 0 | ||||||||||||||||||
921 | || | - | ||||||||||||||||||
922 | colon > &buf[len - 1] - 4 + i
| 0 | ||||||||||||||||||
923 | - | |||||||||||||||||||
924 | - | |||||||||||||||||||
925 | colon = &buf[len - 1] - 4 + i; | - | ||||||||||||||||||
926 | *colon = ':'; | - | ||||||||||||||||||
927 | } never executed: end of block | 0 | ||||||||||||||||||
928 | s = colon + 1; | - | ||||||||||||||||||
929 | } never executed: end of block | 0 | ||||||||||||||||||
930 | } never executed: end of block | 0 | ||||||||||||||||||
931 | } never executed: end of block | 0 | ||||||||||||||||||
932 | } never executed: end of block | 0 | ||||||||||||||||||
933 | - | |||||||||||||||||||
934 | - | |||||||||||||||||||
935 | - | |||||||||||||||||||
936 | - | |||||||||||||||||||
937 | char * | - | ||||||||||||||||||
938 | ERR_error_string(unsigned long e, char *ret) | - | ||||||||||||||||||
939 | { | - | ||||||||||||||||||
940 | static char buf[256]; | - | ||||||||||||||||||
941 | - | |||||||||||||||||||
942 | if (ret ==
| 0 | ||||||||||||||||||
943 | ((void *)0)
| 0 | ||||||||||||||||||
944 | ) | - | ||||||||||||||||||
945 | ret = buf; never executed: ret = buf; | 0 | ||||||||||||||||||
946 | ERR_error_string_n(e, ret, 256); | - | ||||||||||||||||||
947 | - | |||||||||||||||||||
948 | return never executed: ret;return ret; never executed: return ret; | 0 | ||||||||||||||||||
949 | } | - | ||||||||||||||||||
950 | - | |||||||||||||||||||
951 | struct lhash_st_ERR_STRING_DATA *ERR_get_string_table(void) | - | ||||||||||||||||||
952 | { | - | ||||||||||||||||||
953 | err_fns_check(); | - | ||||||||||||||||||
954 | return never executed: err_fns->cb_err_get(0);return err_fns->cb_err_get(0); never executed: return err_fns->cb_err_get(0); | 0 | ||||||||||||||||||
955 | } | - | ||||||||||||||||||
956 | - | |||||||||||||||||||
957 | struct lhash_st_ERR_STATE *ERR_get_err_state_table(void) | - | ||||||||||||||||||
958 | { | - | ||||||||||||||||||
959 | err_fns_check(); | - | ||||||||||||||||||
960 | return never executed: err_fns->cb_thread_get(0);return err_fns->cb_thread_get(0); never executed: return err_fns->cb_thread_get(0); | 0 | ||||||||||||||||||
961 | } | - | ||||||||||||||||||
962 | - | |||||||||||||||||||
963 | void | - | ||||||||||||||||||
964 | ERR_release_err_state_table(struct lhash_st_ERR_STATE **hash) | - | ||||||||||||||||||
965 | { | - | ||||||||||||||||||
966 | err_fns_check(); | - | ||||||||||||||||||
967 | err_fns->cb_thread_release(hash); | - | ||||||||||||||||||
968 | } never executed: end of block | 0 | ||||||||||||||||||
969 | - | |||||||||||||||||||
970 | const char * | - | ||||||||||||||||||
971 | ERR_lib_error_string(unsigned long e) | - | ||||||||||||||||||
972 | { | - | ||||||||||||||||||
973 | ERR_STRING_DATA d, *p; | - | ||||||||||||||||||
974 | unsigned long l; | - | ||||||||||||||||||
975 | - | |||||||||||||||||||
976 | if (!OPENSSL_init_crypto(0,
| 0 | ||||||||||||||||||
977 | ((void *)0)
| 0 | ||||||||||||||||||
978 | )
| 0 | ||||||||||||||||||
979 | return never executed: return ((void *)0) ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
980 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
981 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
982 | - | |||||||||||||||||||
983 | err_fns_check(); | - | ||||||||||||||||||
984 | l = (int)((((unsigned long)e)>>24L)&0xffL); | - | ||||||||||||||||||
985 | d.error = (((((unsigned long)l)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))); | - | ||||||||||||||||||
986 | p = err_fns->cb_err_get_item(&d); | - | ||||||||||||||||||
987 | return never executed: ((return ((p == ((void *)0) ) ? ((void *)0) : p->string);
never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
988 | ((void *)0)
never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
989 | )
never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
990 | ((void *)0) never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
991 | : p->string); never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
992 | } | - | ||||||||||||||||||
993 | - | |||||||||||||||||||
994 | const char * | - | ||||||||||||||||||
995 | ERR_func_error_string(unsigned long e) | - | ||||||||||||||||||
996 | { | - | ||||||||||||||||||
997 | ERR_STRING_DATA d, *p; | - | ||||||||||||||||||
998 | unsigned long l, f; | - | ||||||||||||||||||
999 | - | |||||||||||||||||||
1000 | err_fns_check(); | - | ||||||||||||||||||
1001 | l = (int)((((unsigned long)e)>>24L)&0xffL); | - | ||||||||||||||||||
1002 | f = (int)((((unsigned long)e)>>12L)&0xfffL); | - | ||||||||||||||||||
1003 | d.error = (((((unsigned long)l)&0xffL)<<24L)| ((((unsigned long)f)&0xfffL)<<12L)| ((((unsigned long)0)&0xfffL))); | - | ||||||||||||||||||
1004 | p = err_fns->cb_err_get_item(&d); | - | ||||||||||||||||||
1005 | return executed 7869 times by 31 tests: ((return ((p == ((void *)0) ) ? ((void *)0) : p->string); Executed by:
executed 7869 times by 31 tests: return ((p == ((void *)0) ) ? ((void *)0) : p->string); Executed by:
| 55-7869 | ||||||||||||||||||
1006 | ((void *)0)
executed 7869 times by 31 tests: return ((p == ((void *)0) ) ? ((void *)0) : p->string); Executed by:
| 55-7869 | ||||||||||||||||||
1007 | )
executed 7869 times by 31 tests: return ((p == ((void *)0) ) ? ((void *)0) : p->string); Executed by:
| 55-7869 | ||||||||||||||||||
1008 | ((void *)0) executed 7869 times by 31 tests: return ((p == ((void *)0) ) ? ((void *)0) : p->string); Executed by:
| 7869 | ||||||||||||||||||
1009 | : p->string); executed 7869 times by 31 tests: return ((p == ((void *)0) ) ? ((void *)0) : p->string); Executed by:
| 7869 | ||||||||||||||||||
1010 | } | - | ||||||||||||||||||
1011 | - | |||||||||||||||||||
1012 | const char * | - | ||||||||||||||||||
1013 | ERR_reason_error_string(unsigned long e) | - | ||||||||||||||||||
1014 | { | - | ||||||||||||||||||
1015 | ERR_STRING_DATA d, *p = | - | ||||||||||||||||||
1016 | ((void *)0) | - | ||||||||||||||||||
1017 | ; | - | ||||||||||||||||||
1018 | unsigned long l, r; | - | ||||||||||||||||||
1019 | - | |||||||||||||||||||
1020 | err_fns_check(); | - | ||||||||||||||||||
1021 | l = (int)((((unsigned long)e)>>24L)&0xffL); | - | ||||||||||||||||||
1022 | r = (int)((e)&0xfffL); | - | ||||||||||||||||||
1023 | d.error = (((((unsigned long)l)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)r)&0xfffL))); | - | ||||||||||||||||||
1024 | p = err_fns->cb_err_get_item(&d); | - | ||||||||||||||||||
1025 | if (!p
| 0 | ||||||||||||||||||
1026 | d.error = (((((unsigned long)0)&0xffL)<<24L)| ((((unsigned long)0)&0xfffL)<<12L)| ((((unsigned long)r)&0xfffL))); | - | ||||||||||||||||||
1027 | p = err_fns->cb_err_get_item(&d); | - | ||||||||||||||||||
1028 | } never executed: end of block | 0 | ||||||||||||||||||
1029 | return never executed: ((return ((p == ((void *)0) ) ? ((void *)0) : p->string);
never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
1030 | ((void *)0)
never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
1031 | )
never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
1032 | ((void *)0) never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
1033 | : p->string); never executed: return ((p == ((void *)0) ) ? ((void *)0) : p->string); | 0 | ||||||||||||||||||
1034 | } | - | ||||||||||||||||||
1035 | - | |||||||||||||||||||
1036 | void | - | ||||||||||||||||||
1037 | ERR_remove_thread_state(const CRYPTO_THREADID *id) | - | ||||||||||||||||||
1038 | { | - | ||||||||||||||||||
1039 | ERR_STATE tmp; | - | ||||||||||||||||||
1040 | - | |||||||||||||||||||
1041 | if (id
| 0-269 | ||||||||||||||||||
1042 | CRYPTO_THREADID_cpy(&tmp.tid, id); never executed: CRYPTO_THREADID_cpy(&tmp.tid, id); | 0 | ||||||||||||||||||
1043 | else | - | ||||||||||||||||||
1044 | CRYPTO_THREADID_current(&tmp.tid); executed 269 times by 10 tests: CRYPTO_THREADID_current(&tmp.tid); Executed by:
| 269 | ||||||||||||||||||
1045 | err_fns_check(); | - | ||||||||||||||||||
1046 | - | |||||||||||||||||||
1047 | - | |||||||||||||||||||
1048 | err_fns->cb_thread_del_item(&tmp); | - | ||||||||||||||||||
1049 | } executed 269 times by 10 tests: end of block Executed by:
| 269 | ||||||||||||||||||
1050 | - | |||||||||||||||||||
1051 | - | |||||||||||||||||||
1052 | void | - | ||||||||||||||||||
1053 | ERR_remove_state(unsigned long pid) | - | ||||||||||||||||||
1054 | { | - | ||||||||||||||||||
1055 | ERR_remove_thread_state( | - | ||||||||||||||||||
1056 | ((void *)0) | - | ||||||||||||||||||
1057 | ); | - | ||||||||||||||||||
1058 | } never executed: end of block | 0 | ||||||||||||||||||
1059 | - | |||||||||||||||||||
1060 | - | |||||||||||||||||||
1061 | ERR_STATE * | - | ||||||||||||||||||
1062 | ERR_get_state(void) | - | ||||||||||||||||||
1063 | { | - | ||||||||||||||||||
1064 | static ERR_STATE fallback; | - | ||||||||||||||||||
1065 | ERR_STATE *ret, tmp, *tmpp = | - | ||||||||||||||||||
1066 | ((void *)0) | - | ||||||||||||||||||
1067 | ; | - | ||||||||||||||||||
1068 | int i; | - | ||||||||||||||||||
1069 | CRYPTO_THREADID tid; | - | ||||||||||||||||||
1070 | - | |||||||||||||||||||
1071 | err_fns_check(); | - | ||||||||||||||||||
1072 | CRYPTO_THREADID_current(&tid); | - | ||||||||||||||||||
1073 | CRYPTO_THREADID_cpy(&tmp.tid, &tid); | - | ||||||||||||||||||
1074 | ret = err_fns->cb_thread_get_item(&tmp); | - | ||||||||||||||||||
1075 | - | |||||||||||||||||||
1076 | - | |||||||||||||||||||
1077 | if (ret ==
| 279-9215 | ||||||||||||||||||
1078 | ((void *)0)
| 279-9215 | ||||||||||||||||||
1079 | ) { | - | ||||||||||||||||||
1080 | ret = malloc(sizeof(ERR_STATE)); | - | ||||||||||||||||||
1081 | if (ret ==
| 0-279 | ||||||||||||||||||
1082 | ((void *)0)
| 0-279 | ||||||||||||||||||
1083 | ) | - | ||||||||||||||||||
1084 | return never executed: (&fallback);return (&fallback); never executed: return (&fallback); | 0 | ||||||||||||||||||
1085 | CRYPTO_THREADID_cpy(&ret->tid, &tid); | - | ||||||||||||||||||
1086 | ret->top = 0; | - | ||||||||||||||||||
1087 | ret->bottom = 0; | - | ||||||||||||||||||
1088 | for (i = 0; i < 16
| 279-4464 | ||||||||||||||||||
1089 | ret->err_data[i] = | - | ||||||||||||||||||
1090 | ((void *)0) | - | ||||||||||||||||||
1091 | ; | - | ||||||||||||||||||
1092 | ret->err_data_flags[i] = 0; | - | ||||||||||||||||||
1093 | } executed 4464 times by 20 tests: end of block Executed by:
| 4464 | ||||||||||||||||||
1094 | tmpp = err_fns->cb_thread_set_item(ret); | - | ||||||||||||||||||
1095 | - | |||||||||||||||||||
1096 | if (err_fns->cb_thread_get_item(ret) != ret
| 0-279 | ||||||||||||||||||
1097 | ERR_STATE_free(ret); | - | ||||||||||||||||||
1098 | return never executed: (&fallback);return (&fallback); never executed: return (&fallback); | 0 | ||||||||||||||||||
1099 | } | - | ||||||||||||||||||
1100 | - | |||||||||||||||||||
1101 | - | |||||||||||||||||||
1102 | if (tmpp
| 0-279 | ||||||||||||||||||
1103 | ERR_STATE_free(tmpp); never executed: ERR_STATE_free(tmpp); | 0 | ||||||||||||||||||
1104 | } executed 279 times by 20 tests: end of block Executed by:
| 279 | ||||||||||||||||||
1105 | return executed 9494 times by 20 tests: ret;return ret; Executed by:
executed 9494 times by 20 tests: return ret; Executed by:
| 9494 | ||||||||||||||||||
1106 | } | - | ||||||||||||||||||
1107 | - | |||||||||||||||||||
1108 | int | - | ||||||||||||||||||
1109 | ERR_get_next_error_library(void) | - | ||||||||||||||||||
1110 | { | - | ||||||||||||||||||
1111 | err_fns_check(); | - | ||||||||||||||||||
1112 | return never executed: err_fns->cb_get_next_lib();return err_fns->cb_get_next_lib(); never executed: return err_fns->cb_get_next_lib(); | 0 | ||||||||||||||||||
1113 | } | - | ||||||||||||||||||
1114 | - | |||||||||||||||||||
1115 | void | - | ||||||||||||||||||
1116 | ERR_set_error_data(char *data, int flags) | - | ||||||||||||||||||
1117 | { | - | ||||||||||||||||||
1118 | ERR_STATE *es; | - | ||||||||||||||||||
1119 | int i; | - | ||||||||||||||||||
1120 | - | |||||||||||||||||||
1121 | es = ERR_get_state(); | - | ||||||||||||||||||
1122 | - | |||||||||||||||||||
1123 | i = es->top; | - | ||||||||||||||||||
1124 | if (i == 0
| 0-359 | ||||||||||||||||||
1125 | i = 16 - 1; never executed: i = 16 - 1; | 0 | ||||||||||||||||||
1126 | - | |||||||||||||||||||
1127 | do { if (((
| 0-359 | ||||||||||||||||||
1128 | ((
| 0-359 | ||||||||||||||||||
1129 | )
| 0-359 | ||||||||||||||||||
1130 | ((void *)0) | - | ||||||||||||||||||
1131 | ; } never executed: (es)->err_data_flags[i] = 0; } while(0);end of block | 0 | ||||||||||||||||||
1132 | es->err_data[i] = data; | - | ||||||||||||||||||
1133 | es->err_data_flags[i] = flags; | - | ||||||||||||||||||
1134 | } executed 359 times by 4 tests: end of block Executed by:
| 359 | ||||||||||||||||||
1135 | - | |||||||||||||||||||
1136 | void | - | ||||||||||||||||||
1137 | ERR_asprintf_error_data(char * format, ...) | - | ||||||||||||||||||
1138 | { | - | ||||||||||||||||||
1139 | char *errbuf = | - | ||||||||||||||||||
1140 | ((void *)0) | - | ||||||||||||||||||
1141 | ; | - | ||||||||||||||||||
1142 | va_list ap; | - | ||||||||||||||||||
1143 | int r; | - | ||||||||||||||||||
1144 | - | |||||||||||||||||||
1145 | - | |||||||||||||||||||
1146 | __builtin_va_start( | - | ||||||||||||||||||
1147 | ap | - | ||||||||||||||||||
1148 | , | - | ||||||||||||||||||
1149 | format | - | ||||||||||||||||||
1150 | ) | - | ||||||||||||||||||
1151 | ; | - | ||||||||||||||||||
1152 | r = vasprintf(&errbuf, format, ap); | - | ||||||||||||||||||
1153 | - | |||||||||||||||||||
1154 | __builtin_va_end( | - | ||||||||||||||||||
1155 | ap | - | ||||||||||||||||||
1156 | ) | - | ||||||||||||||||||
1157 | ; | - | ||||||||||||||||||
1158 | if (r == -1
| 0-359 | ||||||||||||||||||
1159 | ERR_set_error_data("malloc failed", 0x02); never executed: ERR_set_error_data("malloc failed", 0x02); | 0 | ||||||||||||||||||
1160 | else | - | ||||||||||||||||||
1161 | ERR_set_error_data(errbuf, 0x01|0x02); executed 359 times by 4 tests: ERR_set_error_data(errbuf, 0x01|0x02); Executed by:
| 359 | ||||||||||||||||||
1162 | } | - | ||||||||||||||||||
1163 | - | |||||||||||||||||||
1164 | void | - | ||||||||||||||||||
1165 | ERR_add_error_vdata(int num, va_list args) | - | ||||||||||||||||||
1166 | { | - | ||||||||||||||||||
1167 | char format[129]; | - | ||||||||||||||||||
1168 | char *errbuf; | - | ||||||||||||||||||
1169 | int i; | - | ||||||||||||||||||
1170 | - | |||||||||||||||||||
1171 | format[0] = '\0'; | - | ||||||||||||||||||
1172 | for (i = 0; i < num
| 0 | ||||||||||||||||||
1173 | if (strlcat(format, "%s", sizeof(format)) >= sizeof(format)
| 0 | ||||||||||||||||||
1174 | ERR_set_error_data("too many errors", 0x02); | - | ||||||||||||||||||
1175 | return; never executed: return; | 0 | ||||||||||||||||||
1176 | } | - | ||||||||||||||||||
1177 | } never executed: end of block | 0 | ||||||||||||||||||
1178 | if (vasprintf(&errbuf, format, args) == -1
| 0 | ||||||||||||||||||
1179 | ERR_set_error_data("malloc failed", 0x02); never executed: ERR_set_error_data("malloc failed", 0x02); | 0 | ||||||||||||||||||
1180 | else | - | ||||||||||||||||||
1181 | ERR_set_error_data(errbuf, 0x01|0x02); never executed: ERR_set_error_data(errbuf, 0x01|0x02); | 0 | ||||||||||||||||||
1182 | } | - | ||||||||||||||||||
1183 | - | |||||||||||||||||||
1184 | void | - | ||||||||||||||||||
1185 | ERR_add_error_data(int num, ...) | - | ||||||||||||||||||
1186 | { | - | ||||||||||||||||||
1187 | va_list args; | - | ||||||||||||||||||
1188 | - | |||||||||||||||||||
1189 | __builtin_va_start( | - | ||||||||||||||||||
1190 | args | - | ||||||||||||||||||
1191 | , | - | ||||||||||||||||||
1192 | num | - | ||||||||||||||||||
1193 | ) | - | ||||||||||||||||||
1194 | ; | - | ||||||||||||||||||
1195 | ERR_add_error_vdata(num, args); | - | ||||||||||||||||||
1196 | - | |||||||||||||||||||
1197 | __builtin_va_end( | - | ||||||||||||||||||
1198 | args | - | ||||||||||||||||||
1199 | ) | - | ||||||||||||||||||
1200 | ; | - | ||||||||||||||||||
1201 | } never executed: end of block | 0 | ||||||||||||||||||
1202 | - | |||||||||||||||||||
1203 | int | - | ||||||||||||||||||
1204 | ERR_set_mark(void) | - | ||||||||||||||||||
1205 | { | - | ||||||||||||||||||
1206 | ERR_STATE *es; | - | ||||||||||||||||||
1207 | - | |||||||||||||||||||
1208 | es = ERR_get_state(); | - | ||||||||||||||||||
1209 | - | |||||||||||||||||||
1210 | if (es->bottom == es->top
| 0 | ||||||||||||||||||
1211 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
1212 | es->err_flags[es->top] |= 0x01; | - | ||||||||||||||||||
1213 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||
1214 | } | - | ||||||||||||||||||
1215 | - | |||||||||||||||||||
1216 | int | - | ||||||||||||||||||
1217 | ERR_pop_to_mark(void) | - | ||||||||||||||||||
1218 | { | - | ||||||||||||||||||
1219 | ERR_STATE *es; | - | ||||||||||||||||||
1220 | - | |||||||||||||||||||
1221 | es = ERR_get_state(); | - | ||||||||||||||||||
1222 | - | |||||||||||||||||||
1223 | while (es->bottom != es->top
| 0 | ||||||||||||||||||
1224 | (
| 0 | ||||||||||||||||||
1225 | do { (es)->err_flags[es->top] = 0; (es)->err_buffer[es->top] = 0; do { if (((
| 0 | ||||||||||||||||||
1226 | ((void *)0)
| 0 | ||||||||||||||||||
1227 | )
| 0 | ||||||||||||||||||
1228 | ((void *)0) | - | ||||||||||||||||||
1229 | ; } never executed: (es)->err_data_flags[es->top] = 0; } while(0); (es)->err_file[es->top] = end of block | 0 | ||||||||||||||||||
1230 | ((void *)0) | - | ||||||||||||||||||
1231 | ; (es)->err_line[es->top] = -1; } while(0); | - | ||||||||||||||||||
1232 | es->top -= 1; | - | ||||||||||||||||||
1233 | if (es->top == -1
| 0 | ||||||||||||||||||
1234 | es->top = 16 - 1; never executed: es->top = 16 - 1; | 0 | ||||||||||||||||||
1235 | } never executed: end of block | 0 | ||||||||||||||||||
1236 | - | |||||||||||||||||||
1237 | if (es->bottom == es->top
| 0 | ||||||||||||||||||
1238 | return never executed: 0;return 0; never executed: return 0; | 0 | ||||||||||||||||||
1239 | es->err_flags[es->top]&=~0x01; | - | ||||||||||||||||||
1240 | return never executed: 1;return 1; never executed: return 1; | 0 | ||||||||||||||||||
1241 | } | - | ||||||||||||||||||
Switch to Source code | Preprocessed file |