| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bio/b_addr.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | CRYPTO_RWLOCK *bio_lookup_lock; | - | ||||||||||||||||||
| 9 | static CRYPTO_ONCE bio_lookup_init = | - | ||||||||||||||||||
| 10 | 0 | - | ||||||||||||||||||
| 11 | ; | - | ||||||||||||||||||
| 12 | BIO_ADDR *BIO_ADDR_new(void) | - | ||||||||||||||||||
| 13 | { | - | ||||||||||||||||||
| 14 | BIO_ADDR *ret = CRYPTO_zalloc(sizeof(*ret), __FILE__, 40); | - | ||||||||||||||||||
| 15 | - | |||||||||||||||||||
| 16 | if (ret ==
| 0-379 | ||||||||||||||||||
| 17 | ((void *)0)
| 0-379 | ||||||||||||||||||
| 18 | ) { | - | ||||||||||||||||||
| 19 | ERR_put_error(32,(144),((1|64)),__FILE__,43); | - | ||||||||||||||||||
| 20 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 21 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 22 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 23 | } | - | ||||||||||||||||||
| 24 | - | |||||||||||||||||||
| 25 | ret->sa.sa_family = | - | ||||||||||||||||||
| 26 | 0 | - | ||||||||||||||||||
| 27 | ; | - | ||||||||||||||||||
| 28 | return executed 379 times by 1 test: ret;return ret;Executed by:
executed 379 times by 1 test: return ret;Executed by:
| 379 | ||||||||||||||||||
| 29 | } | - | ||||||||||||||||||
| 30 | - | |||||||||||||||||||
| 31 | void BIO_ADDR_free(BIO_ADDR *ap) | - | ||||||||||||||||||
| 32 | { | - | ||||||||||||||||||
| 33 | CRYPTO_free(ap, __FILE__, 53); | - | ||||||||||||||||||
| 34 | } executed 555 times by 1 test: end of blockExecuted by:
| 555 | ||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | void BIO_ADDR_clear(BIO_ADDR *ap) | - | ||||||||||||||||||
| 37 | { | - | ||||||||||||||||||
| 38 | memset(ap, 0, sizeof(*ap)); | - | ||||||||||||||||||
| 39 | ap->sa.sa_family = | - | ||||||||||||||||||
| 40 | 0 | - | ||||||||||||||||||
| 41 | ; | - | ||||||||||||||||||
| 42 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | int BIO_ADDR_make(BIO_ADDR *ap, const struct sockaddr *sa) | - | ||||||||||||||||||
| 49 | { | - | ||||||||||||||||||
| 50 | if (sa->sa_family ==
| 0 | ||||||||||||||||||
| 51 | 2
| 0 | ||||||||||||||||||
| 52 | ) { | - | ||||||||||||||||||
| 53 | memcpy(&(ap->s_in), sa, sizeof(struct sockaddr_in)); | - | ||||||||||||||||||
| 54 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 55 | } | - | ||||||||||||||||||
| 56 | - | |||||||||||||||||||
| 57 | if (sa->sa_family ==
| 0 | ||||||||||||||||||
| 58 | 10
| 0 | ||||||||||||||||||
| 59 | ) { | - | ||||||||||||||||||
| 60 | memcpy(&(ap->s_in6), sa, sizeof(struct sockaddr_in6)); | - | ||||||||||||||||||
| 61 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 62 | } | - | ||||||||||||||||||
| 63 | - | |||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | if (sa->sa_family ==
| 0 | ||||||||||||||||||
| 66 | 1
| 0 | ||||||||||||||||||
| 67 | ) { | - | ||||||||||||||||||
| 68 | memcpy(&(ap->s_un), sa, sizeof(struct sockaddr_un)); | - | ||||||||||||||||||
| 69 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 70 | } | - | ||||||||||||||||||
| 71 | - | |||||||||||||||||||
| 72 | - | |||||||||||||||||||
| 73 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 74 | } | - | ||||||||||||||||||
| 75 | - | |||||||||||||||||||
| 76 | int BIO_ADDR_rawmake(BIO_ADDR *ap, int family, | - | ||||||||||||||||||
| 77 | const void *where, size_t wherelen, | - | ||||||||||||||||||
| 78 | unsigned short port) | - | ||||||||||||||||||
| 79 | { | - | ||||||||||||||||||
| 80 | - | |||||||||||||||||||
| 81 | if (family ==
| 0 | ||||||||||||||||||
| 82 | 1
| 0 | ||||||||||||||||||
| 83 | ) { | - | ||||||||||||||||||
| 84 | if (wherelen + 1 > sizeof(ap->s_un.sun_path)
| 0 | ||||||||||||||||||
| 85 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 86 | memset(&ap->s_un, 0, sizeof(ap->s_un)); | - | ||||||||||||||||||
| 87 | ap->s_un.sun_family = family; | - | ||||||||||||||||||
| 88 | - | |||||||||||||||||||
| 89 | __builtin_strncpy ( | - | ||||||||||||||||||
| 90 | ap->s_un.sun_path | - | ||||||||||||||||||
| 91 | , | - | ||||||||||||||||||
| 92 | where | - | ||||||||||||||||||
| 93 | , | - | ||||||||||||||||||
| 94 | sizeof(ap->s_un.sun_path) - 1 | - | ||||||||||||||||||
| 95 | ) | - | ||||||||||||||||||
| 96 | ; | - | ||||||||||||||||||
| 97 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 98 | } | - | ||||||||||||||||||
| 99 | - | |||||||||||||||||||
| 100 | if (family ==
| 0 | ||||||||||||||||||
| 101 | 2
| 0 | ||||||||||||||||||
| 102 | ) { | - | ||||||||||||||||||
| 103 | if (wherelen != sizeof(struct in_addr)
| 0 | ||||||||||||||||||
| 104 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 105 | memset(&ap->s_in, 0, sizeof(ap->s_in)); | - | ||||||||||||||||||
| 106 | ap->s_in.sin_family = family; | - | ||||||||||||||||||
| 107 | ap->s_in.sin_port = port; | - | ||||||||||||||||||
| 108 | ap->s_in.sin_addr = *(struct in_addr *)where; | - | ||||||||||||||||||
| 109 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 110 | } | - | ||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | if (family ==
| 0 | ||||||||||||||||||
| 113 | 10
| 0 | ||||||||||||||||||
| 114 | ) { | - | ||||||||||||||||||
| 115 | if (wherelen != sizeof(struct in6_addr)
| 0 | ||||||||||||||||||
| 116 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 117 | memset(&ap->s_in6, 0, sizeof(ap->s_in6)); | - | ||||||||||||||||||
| 118 | ap->s_in6.sin6_family = family; | - | ||||||||||||||||||
| 119 | ap->s_in6.sin6_port = port; | - | ||||||||||||||||||
| 120 | ap->s_in6.sin6_addr = *(struct in6_addr *)where; | - | ||||||||||||||||||
| 121 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 122 | } | - | ||||||||||||||||||
| 123 | - | |||||||||||||||||||
| 124 | - | |||||||||||||||||||
| 125 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 126 | } | - | ||||||||||||||||||
| 127 | - | |||||||||||||||||||
| 128 | int BIO_ADDR_family(const BIO_ADDR *ap) | - | ||||||||||||||||||
| 129 | { | - | ||||||||||||||||||
| 130 | return executed 178 times by 1 test: ap->sa.sa_family;return ap->sa.sa_family;Executed by:
executed 178 times by 1 test: return ap->sa.sa_family;Executed by:
| 178 | ||||||||||||||||||
| 131 | } | - | ||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | int BIO_ADDR_rawaddress(const BIO_ADDR *ap, void *p, size_t *l) | - | ||||||||||||||||||
| 134 | { | - | ||||||||||||||||||
| 135 | size_t len = 0; | - | ||||||||||||||||||
| 136 | const void *addrptr = | - | ||||||||||||||||||
| 137 | ((void *)0) | - | ||||||||||||||||||
| 138 | ; | - | ||||||||||||||||||
| 139 | - | |||||||||||||||||||
| 140 | if (ap->sa.sa_family ==
| 0 | ||||||||||||||||||
| 141 | 2
| 0 | ||||||||||||||||||
| 142 | ) { | - | ||||||||||||||||||
| 143 | len = sizeof(ap->s_in.sin_addr); | - | ||||||||||||||||||
| 144 | addrptr = &ap->s_in.sin_addr; | - | ||||||||||||||||||
| 145 | } never executed: end of block | 0 | ||||||||||||||||||
| 146 | - | |||||||||||||||||||
| 147 | else if (ap->sa.sa_family ==
| 0 | ||||||||||||||||||
| 148 | 10
| 0 | ||||||||||||||||||
| 149 | ) { | - | ||||||||||||||||||
| 150 | len = sizeof(ap->s_in6.sin6_addr); | - | ||||||||||||||||||
| 151 | addrptr = &ap->s_in6.sin6_addr; | - | ||||||||||||||||||
| 152 | } never executed: end of block | 0 | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | - | |||||||||||||||||||
| 155 | else if (ap->sa.sa_family ==
| 0 | ||||||||||||||||||
| 156 | 1
| 0 | ||||||||||||||||||
| 157 | ) { | - | ||||||||||||||||||
| 158 | len = strlen(ap->s_un.sun_path); | - | ||||||||||||||||||
| 159 | addrptr = &ap->s_un.sun_path; | - | ||||||||||||||||||
| 160 | } never executed: end of block | 0 | ||||||||||||||||||
| 161 | - | |||||||||||||||||||
| 162 | - | |||||||||||||||||||
| 163 | if (addrptr ==
| 0 | ||||||||||||||||||
| 164 | ((void *)0)
| 0 | ||||||||||||||||||
| 165 | ) | - | ||||||||||||||||||
| 166 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 167 | - | |||||||||||||||||||
| 168 | if (p !=
| 0 | ||||||||||||||||||
| 169 | ((void *)0)
| 0 | ||||||||||||||||||
| 170 | ) { | - | ||||||||||||||||||
| 171 | memcpy(p, addrptr, len); | - | ||||||||||||||||||
| 172 | } never executed: end of block | 0 | ||||||||||||||||||
| 173 | if (l !=
| 0 | ||||||||||||||||||
| 174 | ((void *)0)
| 0 | ||||||||||||||||||
| 175 | ) | - | ||||||||||||||||||
| 176 | * never executed: l = len;*l = len;never executed: *l = len; | 0 | ||||||||||||||||||
| 177 | - | |||||||||||||||||||
| 178 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 179 | } | - | ||||||||||||||||||
| 180 | - | |||||||||||||||||||
| 181 | unsigned short BIO_ADDR_rawport(const BIO_ADDR *ap) | - | ||||||||||||||||||
| 182 | { | - | ||||||||||||||||||
| 183 | if (ap->sa.sa_family ==
| 0-176 | ||||||||||||||||||
| 184 | 2
| 0-176 | ||||||||||||||||||
| 185 | ) | - | ||||||||||||||||||
| 186 | return never executed: ap->s_in.sin_port;return ap->s_in.sin_port;never executed: return ap->s_in.sin_port; | 0 | ||||||||||||||||||
| 187 | - | |||||||||||||||||||
| 188 | if (ap->sa.sa_family ==
| 0-176 | ||||||||||||||||||
| 189 | 10
| 0-176 | ||||||||||||||||||
| 190 | ) | - | ||||||||||||||||||
| 191 | return executed 176 times by 1 test: ap->s_in6.sin6_port;return ap->s_in6.sin6_port;Executed by:
executed 176 times by 1 test: return ap->s_in6.sin6_port;Executed by:
| 176 | ||||||||||||||||||
| 192 | - | |||||||||||||||||||
| 193 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 194 | } | - | ||||||||||||||||||
| 195 | static int addr_strings(const BIO_ADDR *ap, int numeric, | - | ||||||||||||||||||
| 196 | char **hostname, char **service) | - | ||||||||||||||||||
| 197 | { | - | ||||||||||||||||||
| 198 | if (BIO_sock_init() != 1
| 0-360 | ||||||||||||||||||
| 199 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 200 | - | |||||||||||||||||||
| 201 | if (1) { | - | ||||||||||||||||||
| 202 | - | |||||||||||||||||||
| 203 | int ret = 0; | - | ||||||||||||||||||
| 204 | char host[ | - | ||||||||||||||||||
| 205 | 1025 | - | ||||||||||||||||||
| 206 | ] = "", serv[ | - | ||||||||||||||||||
| 207 | 32 | - | ||||||||||||||||||
| 208 | ] = ""; | - | ||||||||||||||||||
| 209 | int flags = 0; | - | ||||||||||||||||||
| 210 | - | |||||||||||||||||||
| 211 | if (numeric
| 0-360 | ||||||||||||||||||
| 212 | flags |= executed 360 times by 1 test: flags |= 1 | 2 ;Executed by:
| 360 | ||||||||||||||||||
| 213 | 1 executed 360 times by 1 test: flags |= 1 | 2 ;Executed by:
| 360 | ||||||||||||||||||
| 214 | | executed 360 times by 1 test: flags |= 1 | 2 ;Executed by:
| 360 | ||||||||||||||||||
| 215 | 2 executed 360 times by 1 test: flags |= 1 | 2 ;Executed by:
| 360 | ||||||||||||||||||
| 216 | ; executed 360 times by 1 test: flags |= 1 | 2 ;Executed by:
| 360 | ||||||||||||||||||
| 217 | - | |||||||||||||||||||
| 218 | if ((
| 0-360 | ||||||||||||||||||
| 219 | BIO_ADDR_sockaddr_size(ap),
| 0-360 | ||||||||||||||||||
| 220 | host, sizeof(host), serv, sizeof(serv),
| 0-360 | ||||||||||||||||||
| 221 | flags)) != 0
| 0-360 | ||||||||||||||||||
| 222 | - | |||||||||||||||||||
| 223 | if (ret ==
| 0 | ||||||||||||||||||
| 224 | -11
| 0 | ||||||||||||||||||
| 225 | ) { | - | ||||||||||||||||||
| 226 | ERR_put_error(2,(13),( | - | ||||||||||||||||||
| 227 | (*__errno_location ()) | - | ||||||||||||||||||
| 228 | ),__FILE__,210); | - | ||||||||||||||||||
| 229 | ERR_put_error(32,(134),(2),__FILE__,211); | - | ||||||||||||||||||
| 230 | } never executed: elseend of block | 0 | ||||||||||||||||||
| 231 | - | |||||||||||||||||||
| 232 | { | - | ||||||||||||||||||
| 233 | ERR_put_error(32,(134),(2),__FILE__,215); | - | ||||||||||||||||||
| 234 | ERR_add_error_data(1, gai_strerror(ret)); | - | ||||||||||||||||||
| 235 | } never executed: end of block | 0 | ||||||||||||||||||
| 236 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 237 | } | - | ||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | - | |||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | - | |||||||||||||||||||
| 242 | - | |||||||||||||||||||
| 243 | - | |||||||||||||||||||
| 244 | - | |||||||||||||||||||
| 245 | if (serv[0] == '\0'
| 0-360 | ||||||||||||||||||
| 246 | BIO_snprintf(serv, sizeof(serv), "%d", | - | ||||||||||||||||||
| 247 | - | |||||||||||||||||||
| 248 | (__extension__ ({ unsigned short int __v, __x = (unsigned short int) ( | - | ||||||||||||||||||
| 249 | BIO_ADDR_rawport(ap) | - | ||||||||||||||||||
| 250 | ); if (__builtin_constant_p (__x)
never executed: else __asm____v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8)));never executed: ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc");__asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc");never executed: __v; }))__asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); | 0 | ||||||||||||||||||
| 251 | ); | - | ||||||||||||||||||
| 252 | } never executed: end of block | 0 | ||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | if (hostname !=
| 180 | ||||||||||||||||||
| 255 | ((void *)0)
| 180 | ||||||||||||||||||
| 256 | ) | - | ||||||||||||||||||
| 257 | * executed 180 times by 1 test: hostname = CRYPTO_strdup(host, __FILE__, 233);*hostname = CRYPTO_strdup(host, __FILE__, 233);Executed by:
executed 180 times by 1 test: *hostname = CRYPTO_strdup(host, __FILE__, 233);Executed by:
| 180 | ||||||||||||||||||
| 258 | if (service !=
| 180 | ||||||||||||||||||
| 259 | ((void *)0)
| 180 | ||||||||||||||||||
| 260 | ) | - | ||||||||||||||||||
| 261 | * executed 180 times by 1 test: service = CRYPTO_strdup(serv, __FILE__, 235);*service = CRYPTO_strdup(serv, __FILE__, 235);Executed by:
executed 180 times by 1 test: *service = CRYPTO_strdup(serv, __FILE__, 235);Executed by:
| 180 | ||||||||||||||||||
| 262 | } executed 360 times by 1 test: else {end of blockExecuted by:
dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 263 | - | |||||||||||||||||||
| 264 | if (hostname != dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 265 | ((void *)0) dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 266 | ) dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 267 | *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 268 | if (service != dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 269 | ((void *)0) dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 270 | ) { dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 271 | char serv[6]; dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 272 | BIO_snprintf(serv, sizeof(serv), "%d", dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 273 | (__extension__ ({ unsigned short int __v, __x = (unsigned short int) ( dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 274 | ap->s_in.sin_port dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 275 | ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 276 | ); dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 277 | *service = CRYPTO_strdup(serv, __FILE__, 243); dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 278 | } dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 279 | } dead code: { if (hostname != ((void *)0) ) *hostname = CRYPTO_strdup(inet_ntoa(ap->s_in.sin_addr), __FILE__, 239); if (service != ((void *)0) ) { char serv[6]; BIO_snprintf(serv, sizeof(serv), "%d", (__extension__ ({ unsigned short int __v, __x = (unsigned short int...p->s_in.sin_port ); if (__builtin_constant_p (__x)) __v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8))); else __asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); __v; })) ); *service = CRYPTO_strdup(serv, __FILE__, 243); } } | - | ||||||||||||||||||
| 280 | - | |||||||||||||||||||
| 281 | if ((hostname !=
| 180 | ||||||||||||||||||
| 282 | ((void *)0)
| 180 | ||||||||||||||||||
| 283 | && *
| 0-180 | ||||||||||||||||||
| 284 | ((void *)0)
| 0-180 | ||||||||||||||||||
| 285 | ) | - | ||||||||||||||||||
| 286 | || (service !=
| 180 | ||||||||||||||||||
| 287 | ((void *)0)
| 180 | ||||||||||||||||||
| 288 | && *
| 0-180 | ||||||||||||||||||
| 289 | ((void *)0)
| 0-180 | ||||||||||||||||||
| 290 | )) { | - | ||||||||||||||||||
| 291 | if (hostname !=
| 0 | ||||||||||||||||||
| 292 | ((void *)0)
| 0 | ||||||||||||||||||
| 293 | ) { | - | ||||||||||||||||||
| 294 | CRYPTO_free(*hostname, __FILE__, 250); | - | ||||||||||||||||||
| 295 | *hostname = | - | ||||||||||||||||||
| 296 | ((void *)0) | - | ||||||||||||||||||
| 297 | ; | - | ||||||||||||||||||
| 298 | } never executed: end of block | 0 | ||||||||||||||||||
| 299 | if (service !=
| 0 | ||||||||||||||||||
| 300 | ((void *)0)
| 0 | ||||||||||||||||||
| 301 | ) { | - | ||||||||||||||||||
| 302 | CRYPTO_free(*service, __FILE__, 254); | - | ||||||||||||||||||
| 303 | *service = | - | ||||||||||||||||||
| 304 | ((void *)0) | - | ||||||||||||||||||
| 305 | ; | - | ||||||||||||||||||
| 306 | } never executed: end of block | 0 | ||||||||||||||||||
| 307 | ERR_put_error(32,(134),((1|64)),__FILE__,257); | - | ||||||||||||||||||
| 308 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 309 | } | - | ||||||||||||||||||
| 310 | - | |||||||||||||||||||
| 311 | return executed 360 times by 1 test: 1;return 1;Executed by:
executed 360 times by 1 test: return 1;Executed by:
| 360 | ||||||||||||||||||
| 312 | } | - | ||||||||||||||||||
| 313 | - | |||||||||||||||||||
| 314 | char *BIO_ADDR_hostname_string(const BIO_ADDR *ap, int numeric) | - | ||||||||||||||||||
| 315 | { | - | ||||||||||||||||||
| 316 | char *hostname = | - | ||||||||||||||||||
| 317 | ((void *)0) | - | ||||||||||||||||||
| 318 | ; | - | ||||||||||||||||||
| 319 | - | |||||||||||||||||||
| 320 | if (addr_strings(ap, numeric, &hostname,
| 0-180 | ||||||||||||||||||
| 321 | ((void *)0)
| 0-180 | ||||||||||||||||||
| 322 | )
| 0-180 | ||||||||||||||||||
| 323 | return executed 180 times by 1 test: hostname;return hostname;Executed by:
executed 180 times by 1 test: return hostname;Executed by:
| 180 | ||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 326 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 327 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 328 | } | - | ||||||||||||||||||
| 329 | - | |||||||||||||||||||
| 330 | char *BIO_ADDR_service_string(const BIO_ADDR *ap, int numeric) | - | ||||||||||||||||||
| 331 | { | - | ||||||||||||||||||
| 332 | char *service = | - | ||||||||||||||||||
| 333 | ((void *)0) | - | ||||||||||||||||||
| 334 | ; | - | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | if (addr_strings(ap, numeric,
| 0-180 | ||||||||||||||||||
| 337 | ((void *)0)
| 0-180 | ||||||||||||||||||
| 338 | , &service)
| 0-180 | ||||||||||||||||||
| 339 | return executed 180 times by 1 test: service;return service;Executed by:
executed 180 times by 1 test: return service;Executed by:
| 180 | ||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 342 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 343 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 344 | } | - | ||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | char *BIO_ADDR_path_string(const BIO_ADDR *ap) | - | ||||||||||||||||||
| 347 | { | - | ||||||||||||||||||
| 348 | - | |||||||||||||||||||
| 349 | if (ap->sa.sa_family ==
| 0 | ||||||||||||||||||
| 350 | 1
| 0 | ||||||||||||||||||
| 351 | ) | - | ||||||||||||||||||
| 352 | return never executed: CRYPTO_strdup(ap->s_un.sun_path, __FILE__, 288);return CRYPTO_strdup(ap->s_un.sun_path, __FILE__, 288);never executed: return CRYPTO_strdup(ap->s_un.sun_path, __FILE__, 288); | 0 | ||||||||||||||||||
| 353 | - | |||||||||||||||||||
| 354 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 355 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 356 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 357 | } | - | ||||||||||||||||||
| 358 | - | |||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | - | |||||||||||||||||||
| 361 | - | |||||||||||||||||||
| 362 | - | |||||||||||||||||||
| 363 | - | |||||||||||||||||||
| 364 | const struct sockaddr *BIO_ADDR_sockaddr(const BIO_ADDR *ap) | - | ||||||||||||||||||
| 365 | { | - | ||||||||||||||||||
| 366 | return executed 731 times by 1 test: &(ap->sa);return &(ap->sa);Executed by:
executed 731 times by 1 test: return &(ap->sa);Executed by:
| 731 | ||||||||||||||||||
| 367 | } | - | ||||||||||||||||||
| 368 | - | |||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | - | |||||||||||||||||||
| 371 | - | |||||||||||||||||||
| 372 | - | |||||||||||||||||||
| 373 | - | |||||||||||||||||||
| 374 | - | |||||||||||||||||||
| 375 | struct sockaddr *BIO_ADDR_sockaddr_noconst(BIO_ADDR *ap) | - | ||||||||||||||||||
| 376 | { | - | ||||||||||||||||||
| 377 | return executed 371 times by 1 test: &(ap->sa);return &(ap->sa);Executed by:
executed 371 times by 1 test: return &(ap->sa);Executed by:
| 371 | ||||||||||||||||||
| 378 | } | - | ||||||||||||||||||
| 379 | - | |||||||||||||||||||
| 380 | - | |||||||||||||||||||
| 381 | - | |||||||||||||||||||
| 382 | - | |||||||||||||||||||
| 383 | - | |||||||||||||||||||
| 384 | - | |||||||||||||||||||
| 385 | - | |||||||||||||||||||
| 386 | socklen_t BIO_ADDR_sockaddr_size(const BIO_ADDR *ap) | - | ||||||||||||||||||
| 387 | { | - | ||||||||||||||||||
| 388 | if (ap->sa.sa_family ==
| 6-725 | ||||||||||||||||||
| 389 | 2
| 6-725 | ||||||||||||||||||
| 390 | ) | - | ||||||||||||||||||
| 391 | return executed 6 times by 1 test: sizeof(ap->s_in);return sizeof(ap->s_in);Executed by:
executed 6 times by 1 test: return sizeof(ap->s_in);Executed by:
| 6 | ||||||||||||||||||
| 392 | - | |||||||||||||||||||
| 393 | if (ap->sa.sa_family ==
| 0-725 | ||||||||||||||||||
| 394 | 10
| 0-725 | ||||||||||||||||||
| 395 | ) | - | ||||||||||||||||||
| 396 | return executed 725 times by 1 test: sizeof(ap->s_in6);return sizeof(ap->s_in6);Executed by:
executed 725 times by 1 test: return sizeof(ap->s_in6);Executed by:
| 725 | ||||||||||||||||||
| 397 | - | |||||||||||||||||||
| 398 | - | |||||||||||||||||||
| 399 | if (ap->sa.sa_family ==
| 0 | ||||||||||||||||||
| 400 | 1
| 0 | ||||||||||||||||||
| 401 | ) | - | ||||||||||||||||||
| 402 | return never executed: sizeof(ap->s_un);return sizeof(ap->s_un);never executed: return sizeof(ap->s_un); | 0 | ||||||||||||||||||
| 403 | - | |||||||||||||||||||
| 404 | return never executed: sizeof(*ap);return sizeof(*ap);never executed: return sizeof(*ap); | 0 | ||||||||||||||||||
| 405 | } | - | ||||||||||||||||||
| 406 | - | |||||||||||||||||||
| 407 | - | |||||||||||||||||||
| 408 | - | |||||||||||||||||||
| 409 | - | |||||||||||||||||||
| 410 | - | |||||||||||||||||||
| 411 | - | |||||||||||||||||||
| 412 | - | |||||||||||||||||||
| 413 | const BIO_ADDRINFO *BIO_ADDRINFO_next(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 414 | { | - | ||||||||||||||||||
| 415 | if (bai !=
| 0-176 | ||||||||||||||||||
| 416 | ((void *)0)
| 0-176 | ||||||||||||||||||
| 417 | ) | - | ||||||||||||||||||
| 418 | return executed 176 times by 1 test: bai->ai_next;return bai->ai_next;Executed by:
executed 176 times by 1 test: return bai->ai_next;Executed by:
| 176 | ||||||||||||||||||
| 419 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 420 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 421 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 422 | } | - | ||||||||||||||||||
| 423 | - | |||||||||||||||||||
| 424 | int BIO_ADDRINFO_family(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 425 | { | - | ||||||||||||||||||
| 426 | if (bai !=
| 0-371 | ||||||||||||||||||
| 427 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 428 | ) | - | ||||||||||||||||||
| 429 | return executed 371 times by 1 test: bai->ai_family;return bai->ai_family;Executed by:
executed 371 times by 1 test: return bai->ai_family;Executed by:
| 371 | ||||||||||||||||||
| 430 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 431 | } | - | ||||||||||||||||||
| 432 | - | |||||||||||||||||||
| 433 | int BIO_ADDRINFO_socktype(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 434 | { | - | ||||||||||||||||||
| 435 | if (bai !=
| 0-738 | ||||||||||||||||||
| 436 | ((void *)0)
| 0-738 | ||||||||||||||||||
| 437 | ) | - | ||||||||||||||||||
| 438 | return executed 738 times by 1 test: bai->ai_socktype;return bai->ai_socktype;Executed by:
executed 738 times by 1 test: return bai->ai_socktype;Executed by:
| 738 | ||||||||||||||||||
| 439 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 440 | } | - | ||||||||||||||||||
| 441 | - | |||||||||||||||||||
| 442 | int BIO_ADDRINFO_protocol(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 443 | { | - | ||||||||||||||||||
| 444 | if (bai !=
| 0-371 | ||||||||||||||||||
| 445 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 446 | ) { | - | ||||||||||||||||||
| 447 | if (bai->ai_protocol != 0
| 0-371 | ||||||||||||||||||
| 448 | return executed 371 times by 1 test: bai->ai_protocol;return bai->ai_protocol;Executed by:
executed 371 times by 1 test: return bai->ai_protocol;Executed by:
| 371 | ||||||||||||||||||
| 449 | - | |||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | if (bai->ai_family ==
| 0 | ||||||||||||||||||
| 452 | 1
| 0 | ||||||||||||||||||
| 453 | ) | - | ||||||||||||||||||
| 454 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 455 | - | |||||||||||||||||||
| 456 | - | |||||||||||||||||||
| 457 | switch (bai->ai_socktype) { | - | ||||||||||||||||||
| 458 | case never executed: case SOCK_STREAM :never executed: case SOCK_STREAM : | 0 | ||||||||||||||||||
| 459 | SOCK_STREAM never executed: case SOCK_STREAM : | 0 | ||||||||||||||||||
| 460 | : never executed: case SOCK_STREAM : | 0 | ||||||||||||||||||
| 461 | return never executed: return IPPROTO_TCP ;never executed: return IPPROTO_TCP ; | 0 | ||||||||||||||||||
| 462 | IPPROTO_TCP never executed: return IPPROTO_TCP ; | 0 | ||||||||||||||||||
| 463 | ; never executed: return IPPROTO_TCP ; | 0 | ||||||||||||||||||
| 464 | case never executed: case SOCK_DGRAM :never executed: case SOCK_DGRAM : | 0 | ||||||||||||||||||
| 465 | SOCK_DGRAM never executed: case SOCK_DGRAM : | 0 | ||||||||||||||||||
| 466 | : never executed: case SOCK_DGRAM : | 0 | ||||||||||||||||||
| 467 | return never executed: return IPPROTO_UDP ;never executed: return IPPROTO_UDP ; | 0 | ||||||||||||||||||
| 468 | IPPROTO_UDP never executed: return IPPROTO_UDP ; | 0 | ||||||||||||||||||
| 469 | ; never executed: return IPPROTO_UDP ; | 0 | ||||||||||||||||||
| 470 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 471 | break; never executed: break; | 0 | ||||||||||||||||||
| 472 | } | - | ||||||||||||||||||
| 473 | } | - | ||||||||||||||||||
| 474 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 475 | } | - | ||||||||||||||||||
| 476 | - | |||||||||||||||||||
| 477 | - | |||||||||||||||||||
| 478 | - | |||||||||||||||||||
| 479 | - | |||||||||||||||||||
| 480 | - | |||||||||||||||||||
| 481 | socklen_t BIO_ADDRINFO_sockaddr_size(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 482 | { | - | ||||||||||||||||||
| 483 | if (bai !=
| 0 | ||||||||||||||||||
| 484 | ((void *)0)
| 0 | ||||||||||||||||||
| 485 | ) | - | ||||||||||||||||||
| 486 | return never executed: bai->ai_addrlen;return bai->ai_addrlen;never executed: return bai->ai_addrlen; | 0 | ||||||||||||||||||
| 487 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 488 | } | - | ||||||||||||||||||
| 489 | - | |||||||||||||||||||
| 490 | - | |||||||||||||||||||
| 491 | - | |||||||||||||||||||
| 492 | - | |||||||||||||||||||
| 493 | - | |||||||||||||||||||
| 494 | const struct sockaddr *BIO_ADDRINFO_sockaddr(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 495 | { | - | ||||||||||||||||||
| 496 | if (bai !=
| 0 | ||||||||||||||||||
| 497 | ((void *)0)
| 0 | ||||||||||||||||||
| 498 | ) | - | ||||||||||||||||||
| 499 | return never executed: bai->ai_addr;return bai->ai_addr;never executed: return bai->ai_addr; | 0 | ||||||||||||||||||
| 500 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 501 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 502 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 503 | } | - | ||||||||||||||||||
| 504 | - | |||||||||||||||||||
| 505 | const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 506 | { | - | ||||||||||||||||||
| 507 | if (bai !=
| 0-371 | ||||||||||||||||||
| 508 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 509 | ) | - | ||||||||||||||||||
| 510 | return executed 371 times by 1 test: (BIO_ADDR *)bai->ai_addr;return (BIO_ADDR *)bai->ai_addr;Executed by:
executed 371 times by 1 test: return (BIO_ADDR *)bai->ai_addr;Executed by:
| 371 | ||||||||||||||||||
| 511 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 512 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 513 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||
| 514 | } | - | ||||||||||||||||||
| 515 | - | |||||||||||||||||||
| 516 | void BIO_ADDRINFO_free(BIO_ADDRINFO *bai) | - | ||||||||||||||||||
| 517 | { | - | ||||||||||||||||||
| 518 | if (bai ==
| 0-371 | ||||||||||||||||||
| 519 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 520 | ) | - | ||||||||||||||||||
| 521 | return; never executed: return; | 0 | ||||||||||||||||||
| 522 | - | |||||||||||||||||||
| 523 | - | |||||||||||||||||||
| 524 | - | |||||||||||||||||||
| 525 | - | |||||||||||||||||||
| 526 | - | |||||||||||||||||||
| 527 | - | |||||||||||||||||||
| 528 | - | |||||||||||||||||||
| 529 | if (bai->ai_family !=
| 0-371 | ||||||||||||||||||
| 530 | 1
| 0-371 | ||||||||||||||||||
| 531 | ) { | - | ||||||||||||||||||
| 532 | freeaddrinfo(bai); | - | ||||||||||||||||||
| 533 | return; executed 371 times by 1 test: return;Executed by:
| 371 | ||||||||||||||||||
| 534 | } | - | ||||||||||||||||||
| 535 | - | |||||||||||||||||||
| 536 | - | |||||||||||||||||||
| 537 | - | |||||||||||||||||||
| 538 | - | |||||||||||||||||||
| 539 | - | |||||||||||||||||||
| 540 | while (bai !=
| 0 | ||||||||||||||||||
| 541 | ((void *)0)
| 0 | ||||||||||||||||||
| 542 | ) { | - | ||||||||||||||||||
| 543 | BIO_ADDRINFO *next = bai->ai_next; | - | ||||||||||||||||||
| 544 | CRYPTO_free(bai->ai_addr, __FILE__, 436); | - | ||||||||||||||||||
| 545 | CRYPTO_free(bai, __FILE__, 437); | - | ||||||||||||||||||
| 546 | bai = next; | - | ||||||||||||||||||
| 547 | } never executed: end of block | 0 | ||||||||||||||||||
| 548 | } never executed: end of block | 0 | ||||||||||||||||||
| 549 | int BIO_parse_hostserv(const char *hostserv, char **host, char **service, | - | ||||||||||||||||||
| 550 | enum BIO_hostserv_priorities hostserv_prio) | - | ||||||||||||||||||
| 551 | { | - | ||||||||||||||||||
| 552 | const char *h = | - | ||||||||||||||||||
| 553 | ((void *)0) | - | ||||||||||||||||||
| 554 | ; size_t hl = 0; | - | ||||||||||||||||||
| 555 | const char *p = | - | ||||||||||||||||||
| 556 | ((void *)0) | - | ||||||||||||||||||
| 557 | ; size_t pl = 0; | - | ||||||||||||||||||
| 558 | - | |||||||||||||||||||
| 559 | if (*
| 3-368 | ||||||||||||||||||
| 560 | if ((
| 0-368 | ||||||||||||||||||
| 561 | (__extension__ (__builtin_constant_p (
| 0-368 | ||||||||||||||||||
| 562 | ']'
| 0-368 | ||||||||||||||||||
| 563 | )
| 0-368 | ||||||||||||||||||
| 564 | hostserv
| 0-368 | ||||||||||||||||||
| 565 | )
| 0-368 | ||||||||||||||||||
| 566 | ']'
| 0-368 | ||||||||||||||||||
| 567 | ) == '\0'
| 0-368 | ||||||||||||||||||
| 568 | hostserv
| 0-368 | ||||||||||||||||||
| 569 | ,
| 0-368 | ||||||||||||||||||
| 570 | ']'
| 0-368 | ||||||||||||||||||
| 571 | ) : __builtin_strchr (
| 0-368 | ||||||||||||||||||
| 572 | hostserv
| 0-368 | ||||||||||||||||||
| 573 | ,
| 0-368 | ||||||||||||||||||
| 574 | ']'
| 0-368 | ||||||||||||||||||
| 575 | )))
| 0-368 | ||||||||||||||||||
| 576 | ) ==
| 0-368 | ||||||||||||||||||
| 577 | ((void *)0)
| 0-368 | ||||||||||||||||||
| 578 | ) | - | ||||||||||||||||||
| 579 | goto never executed: spec_err;goto spec_err;never executed: goto spec_err; | 0 | ||||||||||||||||||
| 580 | h = hostserv + 1; | - | ||||||||||||||||||
| 581 | hl = p - h; | - | ||||||||||||||||||
| 582 | p++; | - | ||||||||||||||||||
| 583 | if (*
| 0-368 | ||||||||||||||||||
| 584 | p = never executed: p = ((void *)0) ; | 0 | ||||||||||||||||||
| 585 | ((void *)0) never executed: p = ((void *)0) ; | 0 | ||||||||||||||||||
| 586 | ; never executed: p = ((void *)0) ; | 0 | ||||||||||||||||||
| 587 | else if (*
| 0-368 | ||||||||||||||||||
| 588 | goto never executed: spec_err;goto spec_err;never executed: goto spec_err; | 0 | ||||||||||||||||||
| 589 | else { | - | ||||||||||||||||||
| 590 | p++; | - | ||||||||||||||||||
| 591 | pl = strlen(p); | - | ||||||||||||||||||
| 592 | } executed 368 times by 1 test: end of blockExecuted by:
| 368 | ||||||||||||||||||
| 593 | } else { | - | ||||||||||||||||||
| 594 | const char *p2 = strrchr(hostserv, ':'); | - | ||||||||||||||||||
| 595 | p = | - | ||||||||||||||||||
| 596 | (__extension__ (__builtin_constant_p (
| 0-3 | ||||||||||||||||||
| 597 | ':'
| 0-3 | ||||||||||||||||||
| 598 | )
| 0-3 | ||||||||||||||||||
| 599 | hostserv
| 0-3 | ||||||||||||||||||
| 600 | )
| 0-3 | ||||||||||||||||||
| 601 | ':'
| 0-3 | ||||||||||||||||||
| 602 | ) == '\0'
| 0-3 | ||||||||||||||||||
| 603 | hostserv | - | ||||||||||||||||||
| 604 | , | - | ||||||||||||||||||
| 605 | ':' | - | ||||||||||||||||||
| 606 | ) : __builtin_strchr ( | - | ||||||||||||||||||
| 607 | hostserv | - | ||||||||||||||||||
| 608 | , | - | ||||||||||||||||||
| 609 | ':' | - | ||||||||||||||||||
| 610 | ))) | - | ||||||||||||||||||
| 611 | ; | - | ||||||||||||||||||
| 612 | if (p != p2
| 0-3 | ||||||||||||||||||
| 613 | goto never executed: amb_err;goto amb_err;never executed: goto amb_err; | 0 | ||||||||||||||||||
| 614 | - | |||||||||||||||||||
| 615 | if (p !=
| 0-3 | ||||||||||||||||||
| 616 | ((void *)0)
| 0-3 | ||||||||||||||||||
| 617 | ) { | - | ||||||||||||||||||
| 618 | h = hostserv; | - | ||||||||||||||||||
| 619 | hl = p - h; | - | ||||||||||||||||||
| 620 | p++; | - | ||||||||||||||||||
| 621 | pl = strlen(p); | - | ||||||||||||||||||
| 622 | } executed 3 times by 1 test: else if (hostserv_prio == BIO_PARSE_PRIO_HOSTend of blockExecuted by:
| 0-3 | ||||||||||||||||||
| 623 | h = hostserv; | - | ||||||||||||||||||
| 624 | hl = strlen(h); | - | ||||||||||||||||||
| 625 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 626 | p = hostserv; | - | ||||||||||||||||||
| 627 | pl = strlen(p); | - | ||||||||||||||||||
| 628 | } never executed: end of block | 0 | ||||||||||||||||||
| 629 | } | - | ||||||||||||||||||
| 630 | - | |||||||||||||||||||
| 631 | if (p !=
| 0-371 | ||||||||||||||||||
| 632 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 633 | && | - | ||||||||||||||||||
| 634 | (
| 0-371 | ||||||||||||||||||
| 635 | ':'
| 0-371 | ||||||||||||||||||
| 636 | )
| 0-371 | ||||||||||||||||||
| 637 | p
| 0-371 | ||||||||||||||||||
| 638 | )
| 0-371 | ||||||||||||||||||
| 639 | ':'
| 0-371 | ||||||||||||||||||
| 640 | ) == '\0'
| 0-371 | ||||||||||||||||||
| 641 | p
| 0-371 | ||||||||||||||||||
| 642 | ,
| 0-371 | ||||||||||||||||||
| 643 | ':'
| 0-371 | ||||||||||||||||||
| 644 | ) : __builtin_strchr (
| 0-371 | ||||||||||||||||||
| 645 | p
| 0-371 | ||||||||||||||||||
| 646 | ,
| 0-371 | ||||||||||||||||||
| 647 | ':'
| 0-371 | ||||||||||||||||||
| 648 | )))
| 0-371 | ||||||||||||||||||
| 649 | ) | - | ||||||||||||||||||
| 650 | goto never executed: spec_err;goto spec_err;never executed: goto spec_err; | 0 | ||||||||||||||||||
| 651 | - | |||||||||||||||||||
| 652 | if (h !=
| 0-371 | ||||||||||||||||||
| 653 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 654 | && host !=
| 0-371 | ||||||||||||||||||
| 655 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 656 | ) { | - | ||||||||||||||||||
| 657 | if (hl == 0
| 2-369 | ||||||||||||||||||
| 658 | || (hl == 1
| 0-369 | ||||||||||||||||||
| 659 | *host = | - | ||||||||||||||||||
| 660 | ((void *)0) | - | ||||||||||||||||||
| 661 | ; | - | ||||||||||||||||||
| 662 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||
| 663 | *host = CRYPTO_strndup(h, hl, __FILE__, 526); | - | ||||||||||||||||||
| 664 | if (*
| 0-369 | ||||||||||||||||||
| 665 | ((void *)0)
| 0-369 | ||||||||||||||||||
| 666 | ) | - | ||||||||||||||||||
| 667 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 668 | } executed 369 times by 1 test: end of blockExecuted by:
| 369 | ||||||||||||||||||
| 669 | } | - | ||||||||||||||||||
| 670 | if (p !=
| 0-371 | ||||||||||||||||||
| 671 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 672 | && service !=
| 0-371 | ||||||||||||||||||
| 673 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 674 | ) { | - | ||||||||||||||||||
| 675 | if (pl == 0
| 0-371 | ||||||||||||||||||
| 676 | || (pl == 1
| 0-193 | ||||||||||||||||||
| 677 | *service = | - | ||||||||||||||||||
| 678 | ((void *)0) | - | ||||||||||||||||||
| 679 | ; | - | ||||||||||||||||||
| 680 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 681 | *service = CRYPTO_strndup(p, pl, __FILE__, 536); | - | ||||||||||||||||||
| 682 | if (*
| 0-371 | ||||||||||||||||||
| 683 | ((void *)0)
| 0-371 | ||||||||||||||||||
| 684 | ) | - | ||||||||||||||||||
| 685 | goto never executed: memerr;goto memerr;never executed: goto memerr; | 0 | ||||||||||||||||||
| 686 | } executed 371 times by 1 test: end of blockExecuted by:
| 371 | ||||||||||||||||||
| 687 | } | - | ||||||||||||||||||
| 688 | - | |||||||||||||||||||
| 689 | return executed 371 times by 1 test: 1;return 1;Executed by:
executed 371 times by 1 test: return 1;Executed by:
| 371 | ||||||||||||||||||
| 690 | amb_err: | - | ||||||||||||||||||
| 691 | ERR_put_error(32,(136),(129),__FILE__,544); | - | ||||||||||||||||||
| 692 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 693 | spec_err: | - | ||||||||||||||||||
| 694 | ERR_put_error(32,(136),(130),__FILE__,547); | - | ||||||||||||||||||
| 695 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 696 | memerr: | - | ||||||||||||||||||
| 697 | ERR_put_error(32,(136),((1|64)),__FILE__,550); | - | ||||||||||||||||||
| 698 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 699 | } | - | ||||||||||||||||||
| 700 | static int addrinfo_wrap(int family, int socktype, | - | ||||||||||||||||||
| 701 | const void *where, size_t wherelen, | - | ||||||||||||||||||
| 702 | unsigned short port, | - | ||||||||||||||||||
| 703 | BIO_ADDRINFO **bai) | - | ||||||||||||||||||
| 704 | { | - | ||||||||||||||||||
| 705 | if ((*
| 0 | ||||||||||||||||||
| 706 | ((void *)0)
| 0 | ||||||||||||||||||
| 707 | ) { | - | ||||||||||||||||||
| 708 | ERR_put_error(32,(148),((1|64)),__FILE__,569); | - | ||||||||||||||||||
| 709 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 710 | } | - | ||||||||||||||||||
| 711 | - | |||||||||||||||||||
| 712 | (*bai)->ai_family = family; | - | ||||||||||||||||||
| 713 | (*bai)->ai_socktype = socktype; | - | ||||||||||||||||||
| 714 | if (socktype ==
| 0 | ||||||||||||||||||
| 715 | SOCK_STREAM
| 0 | ||||||||||||||||||
| 716 | ) | - | ||||||||||||||||||
| 717 | (* never executed: bai)->ai_protocol = (*bai)->ai_protocol = IPPROTO_TCP ;never executed: (*bai)->ai_protocol = IPPROTO_TCP ; | 0 | ||||||||||||||||||
| 718 | IPPROTO_TCP never executed: (*bai)->ai_protocol = IPPROTO_TCP ; | 0 | ||||||||||||||||||
| 719 | ; never executed: (*bai)->ai_protocol = IPPROTO_TCP ; | 0 | ||||||||||||||||||
| 720 | if (socktype ==
| 0 | ||||||||||||||||||
| 721 | SOCK_DGRAM
| 0 | ||||||||||||||||||
| 722 | ) | - | ||||||||||||||||||
| 723 | (* never executed: bai)->ai_protocol = (*bai)->ai_protocol = IPPROTO_UDP ;never executed: (*bai)->ai_protocol = IPPROTO_UDP ; | 0 | ||||||||||||||||||
| 724 | IPPROTO_UDP never executed: (*bai)->ai_protocol = IPPROTO_UDP ; | 0 | ||||||||||||||||||
| 725 | ; never executed: (*bai)->ai_protocol = IPPROTO_UDP ; | 0 | ||||||||||||||||||
| 726 | - | |||||||||||||||||||
| 727 | if (family ==
| 0 | ||||||||||||||||||
| 728 | 1
| 0 | ||||||||||||||||||
| 729 | ) | - | ||||||||||||||||||
| 730 | (* never executed: bai)->ai_protocol = 0;(*bai)->ai_protocol = 0;never executed: (*bai)->ai_protocol = 0; | 0 | ||||||||||||||||||
| 731 | - | |||||||||||||||||||
| 732 | { | - | ||||||||||||||||||
| 733 | - | |||||||||||||||||||
| 734 | - | |||||||||||||||||||
| 735 | - | |||||||||||||||||||
| 736 | - | |||||||||||||||||||
| 737 | - | |||||||||||||||||||
| 738 | BIO_ADDR *addr = BIO_ADDR_new(); | - | ||||||||||||||||||
| 739 | if (addr !=
| 0 | ||||||||||||||||||
| 740 | ((void *)0)
| 0 | ||||||||||||||||||
| 741 | ) { | - | ||||||||||||||||||
| 742 | BIO_ADDR_rawmake(addr, family, where, wherelen, port); | - | ||||||||||||||||||
| 743 | (*bai)->ai_addr = BIO_ADDR_sockaddr_noconst(addr); | - | ||||||||||||||||||
| 744 | } never executed: end of block | 0 | ||||||||||||||||||
| 745 | } | - | ||||||||||||||||||
| 746 | (*bai)->ai_next = | - | ||||||||||||||||||
| 747 | ((void *)0) | - | ||||||||||||||||||
| 748 | ; | - | ||||||||||||||||||
| 749 | if ((*
| 0 | ||||||||||||||||||
| 750 | ((void *)0)
| 0 | ||||||||||||||||||
| 751 | ) { | - | ||||||||||||||||||
| 752 | BIO_ADDRINFO_free(*bai); | - | ||||||||||||||||||
| 753 | *bai = | - | ||||||||||||||||||
| 754 | ((void *)0) | - | ||||||||||||||||||
| 755 | ; | - | ||||||||||||||||||
| 756 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 757 | } | - | ||||||||||||||||||
| 758 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 759 | } | - | ||||||||||||||||||
| 760 | - | |||||||||||||||||||
| 761 | static int do_bio_lookup_init(void); static int do_bio_lookup_init_ossl_ret_ = 0; static void do_bio_lookup_init_ossl_(void) { do_bio_lookup_init_ossl_ret_ = do_bio_lookup_init(); } never executed: static int do_bio_lookup_init(void)end of block | 0 | ||||||||||||||||||
| 762 | { | - | ||||||||||||||||||
| 763 | if (!OPENSSL_init_crypto(0,
| 0 | ||||||||||||||||||
| 764 | ((void *)0)
| 0 | ||||||||||||||||||
| 765 | )
| 0 | ||||||||||||||||||
| 766 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 767 | bio_lookup_lock = CRYPTO_THREAD_lock_new(); | - | ||||||||||||||||||
| 768 | return never executed: bio_lookup_lock != return bio_lookup_lock != ((void *)0) ;never executed: return bio_lookup_lock != ((void *)0) ; | 0 | ||||||||||||||||||
| 769 | ((void *)0) never executed: return bio_lookup_lock != ((void *)0) ; | 0 | ||||||||||||||||||
| 770 | ; never executed: return bio_lookup_lock != ((void *)0) ; | 0 | ||||||||||||||||||
| 771 | } | - | ||||||||||||||||||
| 772 | - | |||||||||||||||||||
| 773 | int BIO_lookup(const char *host, const char *service, | - | ||||||||||||||||||
| 774 | enum BIO_lookup_type lookup_type, | - | ||||||||||||||||||
| 775 | int family, int socktype, BIO_ADDRINFO **res) | - | ||||||||||||||||||
| 776 | { | - | ||||||||||||||||||
| 777 | return executed 4 times by 1 test: BIO_lookup_ex(host, service, lookup_type, family, socktype, 0, res);return BIO_lookup_ex(host, service, lookup_type, family, socktype, 0, res);Executed by:
executed 4 times by 1 test: return BIO_lookup_ex(host, service, lookup_type, family, socktype, 0, res);Executed by:
| 4 | ||||||||||||||||||
| 778 | } | - | ||||||||||||||||||
| 779 | int BIO_lookup_ex(const char *host, const char *service, int lookup_type, | - | ||||||||||||||||||
| 780 | int family, int socktype, int protocol, BIO_ADDRINFO **res) | - | ||||||||||||||||||
| 781 | { | - | ||||||||||||||||||
| 782 | int ret = 0; | - | ||||||||||||||||||
| 783 | - | |||||||||||||||||||
| 784 | switch(family) { | - | ||||||||||||||||||
| 785 | case executed 2 times by 1 test: case 2 :Executed by:
executed 2 times by 1 test: case 2 :Executed by:
| 2 | ||||||||||||||||||
| 786 | 2 executed 2 times by 1 test: case 2 :Executed by:
| 2 | ||||||||||||||||||
| 787 | : executed 2 times by 1 test: case 2 :Executed by:
| 2 | ||||||||||||||||||
| 788 | - | |||||||||||||||||||
| 789 | case executed 2 times by 1 test: case 10 :Executed by:
executed 2 times by 1 test: case 10 :Executed by:
| 2 | ||||||||||||||||||
| 790 | 10 executed 2 times by 1 test: case 10 :Executed by:
| 2 | ||||||||||||||||||
| 791 | : executed 2 times by 1 test: case 10 :Executed by:
| 2 | ||||||||||||||||||
| 792 | - | |||||||||||||||||||
| 793 | - | |||||||||||||||||||
| 794 | case never executed: case 1 :never executed: case 1 : | 0 | ||||||||||||||||||
| 795 | 1 never executed: case 1 : | 0 | ||||||||||||||||||
| 796 | : never executed: case 1 : | 0 | ||||||||||||||||||
| 797 | - | |||||||||||||||||||
| 798 | - | |||||||||||||||||||
| 799 | case executed 367 times by 1 test: case 0 :Executed by:
executed 367 times by 1 test: case 0 :Executed by:
| 367 | ||||||||||||||||||
| 800 | 0 executed 367 times by 1 test: case 0 :Executed by:
| 367 | ||||||||||||||||||
| 801 | : executed 367 times by 1 test: case 0 :Executed by:
| 367 | ||||||||||||||||||
| 802 | - | |||||||||||||||||||
| 803 | break; executed 371 times by 1 test: break;Executed by:
| 371 | ||||||||||||||||||
| 804 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 805 | ERR_put_error(32,(143),(131),__FILE__,659); | - | ||||||||||||||||||
| 806 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 807 | } | - | ||||||||||||||||||
| 808 | - | |||||||||||||||||||
| 809 | - | |||||||||||||||||||
| 810 | if (family ==
| 0-371 | ||||||||||||||||||
| 811 | 1
| 0-371 | ||||||||||||||||||
| 812 | ) { | - | ||||||||||||||||||
| 813 | if (addrinfo_wrap(family, socktype, host, strlen(host), 0, res)
| 0 | ||||||||||||||||||
| 814 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 815 | else | - | ||||||||||||||||||
| 816 | ERR_put_error(32,(143),((1|64)),__FILE__,668); never executed: ERR_put_error(32,(143),((1|64)),__FILE__,668); | 0 | ||||||||||||||||||
| 817 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 818 | } | - | ||||||||||||||||||
| 819 | - | |||||||||||||||||||
| 820 | - | |||||||||||||||||||
| 821 | if (BIO_sock_init() != 1
| 0-371 | ||||||||||||||||||
| 822 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 823 | - | |||||||||||||||||||
| 824 | if (1) { | - | ||||||||||||||||||
| 825 | - | |||||||||||||||||||
| 826 | int gai_ret = 0; | - | ||||||||||||||||||
| 827 | struct addrinfo hints; | - | ||||||||||||||||||
| 828 | - | |||||||||||||||||||
| 829 | memset(&hints, 0, sizeof(hints)); | - | ||||||||||||||||||
| 830 | - | |||||||||||||||||||
| 831 | hints.ai_family = family; | - | ||||||||||||||||||
| 832 | hints.ai_socktype = socktype; | - | ||||||||||||||||||
| 833 | hints.ai_protocol = protocol; | - | ||||||||||||||||||
| 834 | - | |||||||||||||||||||
| 835 | if (lookup_type == BIO_LOOKUP_SERVER
| 178-193 | ||||||||||||||||||
| 836 | hints.ai_flags |= executed 178 times by 1 test: hints.ai_flags |= 0x0001 ;Executed by:
| 178 | ||||||||||||||||||
| 837 | 0x0001 executed 178 times by 1 test: hints.ai_flags |= 0x0001 ;Executed by:
| 178 | ||||||||||||||||||
| 838 | ; executed 178 times by 1 test: hints.ai_flags |= 0x0001 ;Executed by:
| 178 | ||||||||||||||||||
| 839 | - | |||||||||||||||||||
| 840 | - | |||||||||||||||||||
| 841 | - | |||||||||||||||||||
| 842 | - | |||||||||||||||||||
| 843 | switch ((gai_ret = getaddrinfo(host, service, &hints, res))) { | - | ||||||||||||||||||
| 844 | - | |||||||||||||||||||
| 845 | case never executed: case -11 :never executed: case -11 : | 0 | ||||||||||||||||||
| 846 | -11 never executed: case -11 : | 0 | ||||||||||||||||||
| 847 | : never executed: case -11 : | 0 | ||||||||||||||||||
| 848 | ERR_put_error(2,(12),( | - | ||||||||||||||||||
| 849 | (*__errno_location ()) | - | ||||||||||||||||||
| 850 | ),__FILE__,696); | - | ||||||||||||||||||
| 851 | ERR_put_error(32,(143),(2),__FILE__,697); | - | ||||||||||||||||||
| 852 | break; never executed: break; | 0 | ||||||||||||||||||
| 853 | - | |||||||||||||||||||
| 854 | case executed 371 times by 1 test: 0:case 0:Executed by:
executed 371 times by 1 test: case 0:Executed by:
| 371 | ||||||||||||||||||
| 855 | ret = 1; | - | ||||||||||||||||||
| 856 | break; executed 371 times by 1 test: break;Executed by:
| 371 | ||||||||||||||||||
| 857 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 858 | ERR_put_error(32,(143),(2),__FILE__,704); | - | ||||||||||||||||||
| 859 | ERR_add_error_data(1, gai_strerror(gai_ret)); | - | ||||||||||||||||||
| 860 | break; never executed: break; | 0 | ||||||||||||||||||
| 861 | } | - | ||||||||||||||||||
| 862 | } else { | - | ||||||||||||||||||
| 863 | - | |||||||||||||||||||
| 864 | const struct hostent *he; | - | ||||||||||||||||||
| 865 | static in_addr_t he_fallback_address; | - | ||||||||||||||||||
| 866 | static const char *he_fallback_addresses[] = | - | ||||||||||||||||||
| 867 | { (char *)&he_fallback_address, | - | ||||||||||||||||||
| 868 | ((void *)0) | - | ||||||||||||||||||
| 869 | }; | - | ||||||||||||||||||
| 870 | - | |||||||||||||||||||
| 871 | static const struct hostent he_fallback = | - | ||||||||||||||||||
| 872 | { | - | ||||||||||||||||||
| 873 | ((void *)0) | - | ||||||||||||||||||
| 874 | , | - | ||||||||||||||||||
| 875 | ((void *)0) | - | ||||||||||||||||||
| 876 | , | - | ||||||||||||||||||
| 877 | 2 | - | ||||||||||||||||||
| 878 | , sizeof(he_fallback_address), | - | ||||||||||||||||||
| 879 | (char **)&he_fallback_addresses }; | - | ||||||||||||||||||
| 880 | - | |||||||||||||||||||
| 881 | - | |||||||||||||||||||
| 882 | - | |||||||||||||||||||
| 883 | - | |||||||||||||||||||
| 884 | struct servent *se; | - | ||||||||||||||||||
| 885 | - | |||||||||||||||||||
| 886 | - | |||||||||||||||||||
| 887 | - | |||||||||||||||||||
| 888 | - | |||||||||||||||||||
| 889 | struct servent se_fallback = { | - | ||||||||||||||||||
| 890 | ((void *)0) | - | ||||||||||||||||||
| 891 | , | - | ||||||||||||||||||
| 892 | ((void *)0) | - | ||||||||||||||||||
| 893 | , 0, | - | ||||||||||||||||||
| 894 | ((void *)0) | - | ||||||||||||||||||
| 895 | }; | - | ||||||||||||||||||
| 896 | - | |||||||||||||||||||
| 897 | - | |||||||||||||||||||
| 898 | if (!(CRYPTO_THREAD_run_once(&bio_lookup_init, do_bio_lookup_init_ossl_)
| 0 | ||||||||||||||||||
| 899 | ERR_put_error(32,(143),((1|64)),__FILE__,746); | - | ||||||||||||||||||
| 900 | ret = 0; | - | ||||||||||||||||||
| 901 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 902 | } | - | ||||||||||||||||||
| 903 | - | |||||||||||||||||||
| 904 | CRYPTO_THREAD_write_lock(bio_lookup_lock); | - | ||||||||||||||||||
| 905 | he_fallback_address = | - | ||||||||||||||||||
| 906 | ((in_addr_t) 0x00000000) | - | ||||||||||||||||||
| 907 | ; | - | ||||||||||||||||||
| 908 | if (host ==
| 0 | ||||||||||||||||||
| 909 | ((void *)0)
| 0 | ||||||||||||||||||
| 910 | ) { | - | ||||||||||||||||||
| 911 | he = &he_fallback; | - | ||||||||||||||||||
| 912 | switch(lookup_type) { | - | ||||||||||||||||||
| 913 | case never executed: BIO_LOOKUP_CLIENT:case BIO_LOOKUP_CLIENT:never executed: case BIO_LOOKUP_CLIENT: | 0 | ||||||||||||||||||
| 914 | he_fallback_address = | - | ||||||||||||||||||
| 915 | ((in_addr_t) 0x7f000001) | - | ||||||||||||||||||
| 916 | ; | - | ||||||||||||||||||
| 917 | break; never executed: break; | 0 | ||||||||||||||||||
| 918 | case never executed: BIO_LOOKUP_SERVER:case BIO_LOOKUP_SERVER:never executed: case BIO_LOOKUP_SERVER: | 0 | ||||||||||||||||||
| 919 | he_fallback_address = | - | ||||||||||||||||||
| 920 | ((in_addr_t) 0x00000000) | - | ||||||||||||||||||
| 921 | ; | - | ||||||||||||||||||
| 922 | break; never executed: break; | 0 | ||||||||||||||||||
| 923 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 924 | - | |||||||||||||||||||
| 925 | - | |||||||||||||||||||
| 926 | ((void) (0)) | - | ||||||||||||||||||
| 927 | ; | - | ||||||||||||||||||
| 928 | ERR_put_error(32,(143),((4|64)),__FILE__,765); | - | ||||||||||||||||||
| 929 | ret = 0; | - | ||||||||||||||||||
| 930 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 931 | } | - | ||||||||||||||||||
| 932 | } else { | - | ||||||||||||||||||
| 933 | he = gethostbyname(host); | - | ||||||||||||||||||
| 934 | - | |||||||||||||||||||
| 935 | if (he ==
| 0 | ||||||||||||||||||
| 936 | ((void *)0)
| 0 | ||||||||||||||||||
| 937 | ) { | - | ||||||||||||||||||
| 938 | ERR_put_error(2,(17),(1000 + | - | ||||||||||||||||||
| 939 | (*__h_errno_location ()) | - | ||||||||||||||||||
| 940 | ),__FILE__,785); | - | ||||||||||||||||||
| 941 | - | |||||||||||||||||||
| 942 | - | |||||||||||||||||||
| 943 | - | |||||||||||||||||||
| 944 | ret = 0; | - | ||||||||||||||||||
| 945 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 946 | } | - | ||||||||||||||||||
| 947 | } never executed: end of block | 0 | ||||||||||||||||||
| 948 | - | |||||||||||||||||||
| 949 | if (service ==
| 0 | ||||||||||||||||||
| 950 | ((void *)0)
| 0 | ||||||||||||||||||
| 951 | ) { | - | ||||||||||||||||||
| 952 | se_fallback.s_port = 0; | - | ||||||||||||||||||
| 953 | se_fallback.s_proto = | - | ||||||||||||||||||
| 954 | ((void *)0) | - | ||||||||||||||||||
| 955 | ; | - | ||||||||||||||||||
| 956 | se = &se_fallback; | - | ||||||||||||||||||
| 957 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 958 | char *endp = | - | ||||||||||||||||||
| 959 | ((void *)0) | - | ||||||||||||||||||
| 960 | ; | - | ||||||||||||||||||
| 961 | long portnum = strtol(service, &endp, 10); | - | ||||||||||||||||||
| 962 | char *proto = | - | ||||||||||||||||||
| 963 | ((void *)0) | - | ||||||||||||||||||
| 964 | ; | - | ||||||||||||||||||
| 965 | - | |||||||||||||||||||
| 966 | - | |||||||||||||||||||
| 967 | - | |||||||||||||||||||
| 968 | - | |||||||||||||||||||
| 969 | switch (socktype) { | - | ||||||||||||||||||
| 970 | case never executed: case SOCK_STREAM :never executed: case SOCK_STREAM : | 0 | ||||||||||||||||||
| 971 | SOCK_STREAM never executed: case SOCK_STREAM : | 0 | ||||||||||||||||||
| 972 | : never executed: case SOCK_STREAM : | 0 | ||||||||||||||||||
| 973 | proto = "tcp"; | - | ||||||||||||||||||
| 974 | break; never executed: break; | 0 | ||||||||||||||||||
| 975 | case never executed: case SOCK_DGRAM :never executed: case SOCK_DGRAM : | 0 | ||||||||||||||||||
| 976 | SOCK_DGRAM never executed: case SOCK_DGRAM : | 0 | ||||||||||||||||||
| 977 | : never executed: case SOCK_DGRAM : | 0 | ||||||||||||||||||
| 978 | proto = "udp"; | - | ||||||||||||||||||
| 979 | break; never executed: break; | 0 | ||||||||||||||||||
| 980 | } | - | ||||||||||||||||||
| 981 | - | |||||||||||||||||||
| 982 | if (endp != service
| 0 | ||||||||||||||||||
| 983 | && portnum > 0
| 0 | ||||||||||||||||||
| 984 | se_fallback.s_port = | - | ||||||||||||||||||
| 985 | (__extension__ ({ unsigned short int __v, __x = (unsigned short int) ( | - | ||||||||||||||||||
| 986 | (unsigned short)portnum | - | ||||||||||||||||||
| 987 | ); if (__builtin_constant_p (__x)
never executed: else __asm____v = ((unsigned short int) ((((__x) >> 8) & 0xff) | (((__x) & 0xff) << 8)));never executed: ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc");__asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc");never executed: __v; }))__asm__ ("rorw $8, %w0" : "=r" (__v) : "0" (__x) : "cc"); | 0 | ||||||||||||||||||
| 988 | ; | - | ||||||||||||||||||
| 989 | se_fallback.s_proto = proto; | - | ||||||||||||||||||
| 990 | se = &se_fallback; | - | ||||||||||||||||||
| 991 | } never executed: else if (endp == serviceend of block
| 0 | ||||||||||||||||||
| 992 | se = getservbyname(service, proto); | - | ||||||||||||||||||
| 993 | - | |||||||||||||||||||
| 994 | if (se ==
| 0 | ||||||||||||||||||
| 995 | ((void *)0)
| 0 | ||||||||||||||||||
| 996 | ) { | - | ||||||||||||||||||
| 997 | - | |||||||||||||||||||
| 998 | ERR_put_error(2,(3),( | - | ||||||||||||||||||
| 999 | (*__errno_location ()) | - | ||||||||||||||||||
| 1000 | ),__FILE__,834); | - | ||||||||||||||||||
| 1001 | - | |||||||||||||||||||
| 1002 | - | |||||||||||||||||||
| 1003 | - | |||||||||||||||||||
| 1004 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 1005 | } | - | ||||||||||||||||||
| 1006 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 1007 | ERR_put_error(32,(143),(130),__FILE__,841); | - | ||||||||||||||||||
| 1008 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 1009 | } | - | ||||||||||||||||||
| 1010 | } | - | ||||||||||||||||||
| 1011 | - | |||||||||||||||||||
| 1012 | *res = | - | ||||||||||||||||||
| 1013 | ((void *)0) | - | ||||||||||||||||||
| 1014 | ; | - | ||||||||||||||||||
| 1015 | - | |||||||||||||||||||
| 1016 | { | - | ||||||||||||||||||
| 1017 | char **addrlistp; | - | ||||||||||||||||||
| 1018 | - | |||||||||||||||||||
| 1019 | - | |||||||||||||||||||
| 1020 | - | |||||||||||||||||||
| 1021 | size_t addresses; | - | ||||||||||||||||||
| 1022 | BIO_ADDRINFO *tmp_bai = | - | ||||||||||||||||||
| 1023 | ((void *)0) | - | ||||||||||||||||||
| 1024 | ; | - | ||||||||||||||||||
| 1025 | - | |||||||||||||||||||
| 1026 | - | |||||||||||||||||||
| 1027 | - | |||||||||||||||||||
| 1028 | for(addrlistp = he->h_addr_list; *
| 0 | ||||||||||||||||||
| 1029 | ((void *)0)
| 0 | ||||||||||||||||||
| 1030 | ; | - | ||||||||||||||||||
| 1031 | addrlistp++) | - | ||||||||||||||||||
| 1032 | ; never executed: ; | 0 | ||||||||||||||||||
| 1033 | - | |||||||||||||||||||
| 1034 | for(addresses = addrlistp - he->h_addr_list; | - | ||||||||||||||||||
| 1035 | addrlistp--, addresses-- > 0
| 0 | ||||||||||||||||||
| 1036 | if (!addrinfo_wrap(he->h_addrtype, socktype,
| 0 | ||||||||||||||||||
| 1037 | *addrlistp, he->h_length,
| 0 | ||||||||||||||||||
| 1038 | se->s_port, &tmp_bai)
| 0 | ||||||||||||||||||
| 1039 | goto never executed: addrinfo_malloc_err;goto addrinfo_malloc_err;never executed: goto addrinfo_malloc_err; | 0 | ||||||||||||||||||
| 1040 | tmp_bai->ai_next = *res; | - | ||||||||||||||||||
| 1041 | *res = tmp_bai; | - | ||||||||||||||||||
| 1042 | continue; never executed: continue; | 0 | ||||||||||||||||||
| 1043 | addrinfo_malloc_err: | - | ||||||||||||||||||
| 1044 | BIO_ADDRINFO_free(*res); | - | ||||||||||||||||||
| 1045 | *res = | - | ||||||||||||||||||
| 1046 | ((void *)0) | - | ||||||||||||||||||
| 1047 | ; | - | ||||||||||||||||||
| 1048 | ERR_put_error(32,(143),((1|64)),__FILE__,883); | - | ||||||||||||||||||
| 1049 | ret = 0; | - | ||||||||||||||||||
| 1050 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 1051 | } | - | ||||||||||||||||||
| 1052 | - | |||||||||||||||||||
| 1053 | ret = 1; | - | ||||||||||||||||||
| 1054 | } | - | ||||||||||||||||||
| 1055 | err: code before this statement never executed: err: | 0 | ||||||||||||||||||
| 1056 | CRYPTO_THREAD_unlock(bio_lookup_lock); | - | ||||||||||||||||||
| 1057 | } never executed: end of block | 0 | ||||||||||||||||||
| 1058 | - | |||||||||||||||||||
| 1059 | return executed 371 times by 1 test: ret;return ret;Executed by:
executed 371 times by 1 test: return ret;Executed by:
| 371 | ||||||||||||||||||
| 1060 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |