| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | TXT_DB * | - |
| 7 | TXT_DB_read(BIO *in, int num) | - |
| 8 | { | - |
| 9 | TXT_DB *ret = | - |
| 10 | ((void *)0) | - |
| 11 | ; | - |
| 12 | int er = 1; | - |
| 13 | int esc = 0; | - |
| 14 | long ln = 0; | - |
| 15 | int i, add, n; | - |
| 16 | int size = 512; | - |
| 17 | int offset = 0; | - |
| 18 | char *p, *f; | - |
| 19 | OPENSSL_STRING *pp; | - |
| 20 | BUF_MEM *buf = | - |
| 21 | ((void *)0) | - |
| 22 | ; | - |
| 23 | | - |
| 24 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
buf = BUF_MEM_new()) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 25 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 26 | ) | - |
| 27 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 28 | if (!BUF_MEM_grow(buf, size)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 29 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 30 | | - |
| 31 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
ret = malloc(sizeof(TXT_DB))) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 32 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 33 | ) | - |
| 34 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 35 | ret->num_fields = num; | - |
| 36 | ret->index = | - |
| 37 | ((void *)0) | - |
| 38 | ; | - |
| 39 | ret->qual = | - |
| 40 | ((void *)0) | - |
| 41 | ; | - |
| 42 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
ret->data = ((struct stack_st_OPENSSL_PSTRING *)sk_new_null())) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 43 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 44 | ) | - |
| 45 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 46 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
ret->index = reallocarray(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 47 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 48 | , num, sizeof(*ret->index))) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 49 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 50 | ) | - |
| 51 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 52 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
ret->qual = reallocarray(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 53 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 54 | , num, sizeof(*(ret->qual)))) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 55 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 56 | ) | - |
| 57 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 58 | for (i = 0; i < num| TRUE | never evaluated | | FALSE | never evaluated |
; i++) { | 0 |
| 59 | ret->index[i] = | - |
| 60 | ((void *)0) | - |
| 61 | ; | - |
| 62 | ret->qual[i] = | - |
| 63 | ((void *)0) | - |
| 64 | ; | - |
| 65 | } never executed: end of block | 0 |
| 66 | | - |
| 67 | add = (num + 1)*sizeof(char *); | - |
| 68 | buf->data[size-1] = '\0'; | - |
| 69 | offset = 0; | - |
| 70 | for (;;) { | - |
| 71 | if (offset != 0| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 72 | size += 512; | - |
| 73 | if (!BUF_MEM_grow_clean(buf, size)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 74 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 75 | } never executed: end of block | 0 |
| 76 | buf->data[offset] = '\0'; | - |
| 77 | BIO_gets(in, &(buf->data[offset]), size - offset); | - |
| 78 | ln++; | - |
| 79 | if (buf->data[offset] == '\0'| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 80 | break; never executed: break; | 0 |
| 81 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
offset == 0)| TRUE | never evaluated | | FALSE | never evaluated |
&& (| TRUE | never evaluated | | FALSE | never evaluated |
buf->data[0] == '#')| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 82 | continue; never executed: continue; | 0 |
| 83 | i = strlen(&(buf->data[offset])); | - |
| 84 | offset += i; | - |
| 85 | if (buf->data[offset-1] != '\n'| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 86 | continue; never executed: continue; | 0 |
| 87 | else { | - |
| 88 | buf->data[offset-1] = '\0'; | - |
| 89 | if (!(p = malloc(add + offset))| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 90 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 91 | offset = 0; | - |
| 92 | } never executed: end of block | 0 |
| 93 | pp = (char **)p; | - |
| 94 | p += add; | - |
| 95 | n = 0; | - |
| 96 | pp[n++] = p; | - |
| 97 | i = 0; | - |
| 98 | f = buf->data; | - |
| 99 | | - |
| 100 | esc = 0; | - |
| 101 | for (;;) { | - |
| 102 | if (*| TRUE | never evaluated | | FALSE | never evaluated |
f == '\0'| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 103 | break; never executed: break; | 0 |
| 104 | if (*| TRUE | never evaluated | | FALSE | never evaluated |
f == '\t'| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 105 | if (esc| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 106 | p--; never executed: p--; | 0 |
| 107 | else { | - |
| 108 | *(p++)='\0'; | - |
| 109 | f++; | - |
| 110 | if (n >= num| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 111 | break; never executed: break; | 0 |
| 112 | pp[n++] = p; | - |
| 113 | continue; never executed: continue; | 0 |
| 114 | } | - |
| 115 | } | - |
| 116 | esc=(*f == '\\'); | - |
| 117 | *(p++)= *(f++); | - |
| 118 | } never executed: end of block | 0 |
| 119 | *(p++)='\0'; | - |
| 120 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
n != num)| TRUE | never evaluated | | FALSE | never evaluated |
|| (*| TRUE | never evaluated | | FALSE | never evaluated |
f != '\0')| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 121 | fprintf( | - |
| 122 | stderr | - |
| 123 | , "wrong number of fields on line %ld (looking for field %d, got %d, '%s' left)\n",ln,num,n,f); | - |
| 124 | er = 2; | - |
| 125 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 126 | } | - |
| 127 | pp[n] = p; | - |
| 128 | if (!sk_push(((_STACK*) (1 ? ret->data : (struct stack_st_OPENSSL_PSTRING*)0)), ((void*) (1 ? pp : (OPENSSL_STRING*)0)))| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 129 | fprintf( | - |
| 130 | stderr | - |
| 131 | , "failure in sk_push\n"); | - |
| 132 | er = 2; | - |
| 133 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 134 | } | - |
| 135 | } never executed: end of block | 0 |
| 136 | er = 0; | - |
| 137 | | - |
| 138 | err: code before this statement never executed: err: | 0 |
| 139 | BUF_MEM_free(buf); | - |
| 140 | if (er| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 141 | if (er == 1| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 142 | fprintf( never executed: fprintf( stderr , "malloc failure\n"); | 0 |
| 143 | stderr never executed: fprintf( stderr , "malloc failure\n"); | 0 |
| 144 | , "malloc failure\n"); never executed: fprintf( stderr , "malloc failure\n"); | 0 |
| 145 | if (ret != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 146 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 147 | ) { | - |
| 148 | if (ret->data != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 149 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 150 | ) | - |
| 151 | sk_free(((_STACK*) (1 ? ret->data : (struct stack_st_OPENSSL_PSTRING*)0))); never executed: sk_free(((_STACK*) (1 ? ret->data : (struct stack_st_OPENSSL_PSTRING*)0))); | 0 |
| 152 | free(ret->index); | - |
| 153 | free(ret->qual); | - |
| 154 | free(ret); | - |
| 155 | } never executed: end of block | 0 |
| 156 | return never executed: return ( ((void *)0) ); (never executed: return ( ((void *)0) ); | 0 |
| 157 | ((void *)0) never executed: return ( ((void *)0) ); | 0 |
| 158 | ); never executed: return ( ((void *)0) ); | 0 |
| 159 | } else | - |
| 160 | return never executed: return (ret); (ret);never executed: return (ret); | 0 |
| 161 | } | - |
| 162 | | - |
| 163 | OPENSSL_STRING * | - |
| 164 | TXT_DB_get_by_index(TXT_DB *db, int idx, OPENSSL_STRING *value) | - |
| 165 | { | - |
| 166 | OPENSSL_STRING *ret; | - |
| 167 | struct lhash_st_OPENSSL_STRING *lh; | - |
| 168 | | - |
| 169 | if (idx >= db->num_fields| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 170 | db->error = 3; | - |
| 171 | return never executed: return ( ((void *)0) ); (never executed: return ( ((void *)0) ); | 0 |
| 172 | ((void *)0) never executed: return ( ((void *)0) ); | 0 |
| 173 | ); never executed: return ( ((void *)0) ); | 0 |
| 174 | } | - |
| 175 | lh = db->index[idx]; | - |
| 176 | if (lh == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 177 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 178 | ) { | - |
| 179 | db->error = 4; | - |
| 180 | return never executed: return ( ((void *)0) ); (never executed: return ( ((void *)0) ); | 0 |
| 181 | ((void *)0) never executed: return ( ((void *)0) ); | 0 |
| 182 | ); never executed: return ( ((void *)0) ); | 0 |
| 183 | } | - |
| 184 | ret = ((OPENSSL_STRING *)lh_retrieve(((_LHASH *)((void*) (1 ? lh : (struct lhash_st_OPENSSL_STRING*)0))), ((void*) (1 ? value : (OPENSSL_STRING*)0)))); | - |
| 185 | db->error = 0; | - |
| 186 | return never executed: return (ret); (ret);never executed: return (ret); | 0 |
| 187 | } | - |
| 188 | | - |
| 189 | int | - |
| 190 | TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *), | - |
| 191 | LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp) | - |
| 192 | { | - |
| 193 | struct lhash_st_OPENSSL_STRING *idx; | - |
| 194 | OPENSSL_STRING *r; | - |
| 195 | int i, n; | - |
| 196 | | - |
| 197 | if (field >= db->num_fields| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 198 | db->error = 3; | - |
| 199 | return never executed: return (0); (0);never executed: return (0); | 0 |
| 200 | } | - |
| 201 | | - |
| 202 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
idx = (struct lhash_st_OPENSSL_STRING *)lh_new(hash, cmp)) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 203 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 204 | ) { | - |
| 205 | db->error = 1; | - |
| 206 | return never executed: return (0); (0);never executed: return (0); | 0 |
| 207 | } | - |
| 208 | n = sk_num(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0))); | - |
| 209 | for (i = 0; i < n| TRUE | never evaluated | | FALSE | never evaluated |
; i++) { | 0 |
| 210 | r = ((OPENSSL_PSTRING)sk_value(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0)), i)); | - |
| 211 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
qual != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 212 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 213 | )| TRUE | never evaluated | | FALSE | never evaluated |
&& (| TRUE | never evaluated | | FALSE | never evaluated |
qual(r) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 214 | continue; never executed: continue; | 0 |
| 215 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
r = ((OPENSSL_STRING *)lh_insert(((_LHASH *)((void*) (1 ? idx : (struct lhash_st_OPENSSL_STRING*)0))), ((void*) (1 ? r : (OPENSSL_STRING*)0))))) != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 216 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 217 | ) { | - |
| 218 | db->error = 2; | - |
| 219 | db->arg1 = sk_find(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0)), ((void*) (1 ? r : (OPENSSL_STRING*)0))); | - |
| 220 | db->arg2 = i; | - |
| 221 | lh_free(((_LHASH *)((void*) (1 ? idx : (struct lhash_st_OPENSSL_STRING*)0)))); | - |
| 222 | return never executed: return (0); (0);never executed: return (0); | 0 |
| 223 | } | - |
| 224 | } never executed: end of block | 0 |
| 225 | if (db->index[field] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 226 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 227 | ) | - |
| 228 | lh_free(((_LHASH *)((void*) (1 ? db->index[field] : (struct lhash_st_OPENSSL_STRING*)0)))); never executed: lh_free(((_LHASH *)((void*) (1 ? db->index[field] : (struct lhash_st_OPENSSL_STRING*)0)))); | 0 |
| 229 | db->index[field] = idx; | - |
| 230 | db->qual[field] = qual; | - |
| 231 | return never executed: return (1); (1);never executed: return (1); | 0 |
| 232 | } | - |
| 233 | | - |
| 234 | long | - |
| 235 | TXT_DB_write(BIO *out, TXT_DB *db) | - |
| 236 | { | - |
| 237 | long i, j,n, nn, l, tot = 0; | - |
| 238 | char *p, **pp, *f; | - |
| 239 | BUF_MEM *buf = | - |
| 240 | ((void *)0) | - |
| 241 | ; | - |
| 242 | long ret = -1; | - |
| 243 | | - |
| 244 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
buf = BUF_MEM_new()) == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 245 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 246 | ) | - |
| 247 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 248 | n = sk_num(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0))); | - |
| 249 | nn = db->num_fields; | - |
| 250 | for (i = 0; i < n| TRUE | never evaluated | | FALSE | never evaluated |
; i++) { | 0 |
| 251 | pp = ((OPENSSL_PSTRING)sk_value(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0)), i)); | - |
| 252 | | - |
| 253 | l = 0; | - |
| 254 | for (j = 0; j < nn| TRUE | never evaluated | | FALSE | never evaluated |
; j++) { | 0 |
| 255 | if (pp[j] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 256 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 257 | ) | - |
| 258 | l += strlen(pp[j]); never executed: l += strlen(pp[j]); | 0 |
| 259 | } never executed: end of block | 0 |
| 260 | if (!BUF_MEM_grow_clean(buf, (int)(l*2 + nn))| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 261 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 262 | | - |
| 263 | p = buf->data; | - |
| 264 | for (j = 0; j < nn| TRUE | never evaluated | | FALSE | never evaluated |
; j++) { | 0 |
| 265 | f = pp[j]; | - |
| 266 | if (f != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 267 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 268 | ) | - |
| 269 | for (;;) { | - |
| 270 | if (*| TRUE | never evaluated | | FALSE | never evaluated |
f == '\0'| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 271 | break; never executed: break; | 0 |
| 272 | if (*| TRUE | never evaluated | | FALSE | never evaluated |
f == '\t'| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 273 | *( never executed: *(p++) = '\\'; p++) = '\\';never executed: *(p++) = '\\'; | 0 |
| 274 | *(p++) = *(f++); | - |
| 275 | } never executed: end of block | 0 |
| 276 | *(p++) = '\t'; | - |
| 277 | } never executed: end of block | 0 |
| 278 | p[-1] = '\n'; | - |
| 279 | j = p - buf->data; | - |
| 280 | if (BIO_write(out, buf->data, (int)j) != j| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 281 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 282 | tot += j; | - |
| 283 | } never executed: end of block | 0 |
| 284 | ret = tot; | - |
| 285 | | - |
| 286 | err: code before this statement never executed: err: | 0 |
| 287 | if (buf != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 288 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 289 | ) | - |
| 290 | BUF_MEM_free(buf); never executed: BUF_MEM_free(buf); | 0 |
| 291 | return never executed: return (ret); (ret);never executed: return (ret); | 0 |
| 292 | } | - |
| 293 | | - |
| 294 | int | - |
| 295 | TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *row) | - |
| 296 | { | - |
| 297 | int i; | - |
| 298 | OPENSSL_STRING *r; | - |
| 299 | | - |
| 300 | for (i = 0; i < db->num_fields| TRUE | never evaluated | | FALSE | never evaluated |
; i++) { | 0 |
| 301 | if (db->index[i] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 302 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 303 | ) { | - |
| 304 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
db->qual[i] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 305 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 306 | )| TRUE | never evaluated | | FALSE | never evaluated |
&& (| TRUE | never evaluated | | FALSE | never evaluated |
db->qual[i](row) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 307 | continue; never executed: continue; | 0 |
| 308 | r = ((OPENSSL_STRING *)lh_retrieve(((_LHASH *)((void*) (1 ? db->index[i] : (struct lhash_st_OPENSSL_STRING*)0))), ((void*) (1 ? row : (OPENSSL_STRING*)0)))); | - |
| 309 | if (r != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 310 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 311 | ) { | - |
| 312 | db->error = 2; | - |
| 313 | db->arg1 = i; | - |
| 314 | db->arg_row = r; | - |
| 315 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 316 | } | - |
| 317 | } never executed: end of block | 0 |
| 318 | } never executed: end of block | 0 |
| 319 | | - |
| 320 | if (!sk_push(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0)), ((void*) (1 ? row : (OPENSSL_STRING*)0)))| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0 |
| 321 | db->error = 1; | - |
| 322 | goto never executed: goto err; err;never executed: goto err; | 0 |
| 323 | } | - |
| 324 | | - |
| 325 | for (i = 0; i < db->num_fields| TRUE | never evaluated | | FALSE | never evaluated |
; i++) { | 0 |
| 326 | if (db->index[i] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 327 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 328 | ) { | - |
| 329 | if ((| TRUE | never evaluated | | FALSE | never evaluated |
db->qual[i] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 330 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 331 | )| TRUE | never evaluated | | FALSE | never evaluated |
&& (| TRUE | never evaluated | | FALSE | never evaluated |
db->qual[i](row) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 332 | continue; never executed: continue; | 0 |
| 333 | (void)((OPENSSL_STRING *)lh_insert(((_LHASH *)((void*) (1 ? db->index[i] : (struct lhash_st_OPENSSL_STRING*)0))), ((void*) (1 ? row : (OPENSSL_STRING*)0)))); | - |
| 334 | } never executed: end of block | 0 |
| 335 | } never executed: end of block | 0 |
| 336 | return never executed: return (1); (1);never executed: return (1); | 0 |
| 337 | | - |
| 338 | err: | - |
| 339 | return never executed: return (0); (0);never executed: return (0); | 0 |
| 340 | } | - |
| 341 | | - |
| 342 | void | - |
| 343 | TXT_DB_free(TXT_DB *db) | - |
| 344 | { | - |
| 345 | int i, n; | - |
| 346 | char **p, *max; | - |
| 347 | | - |
| 348 | if (db == | TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 349 | ((void *)0)| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
| 0-1 |
| 350 | ) | - |
| 351 | return;executed 1 time by 1 test: return; | 1 |
| 352 | | - |
| 353 | if (db->index != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 354 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 355 | ) { | - |
| 356 | for (i = db->num_fields - 1; i >= 0| TRUE | never evaluated | | FALSE | never evaluated |
; i--) | 0 |
| 357 | if (db->index[i] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 358 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 359 | ) | - |
| 360 | lh_free(((_LHASH *)((void*) (1 ? db->index[i] : (struct lhash_st_OPENSSL_STRING*)0)))); never executed: lh_free(((_LHASH *)((void*) (1 ? db->index[i] : (struct lhash_st_OPENSSL_STRING*)0)))); | 0 |
| 361 | free(db->index); | - |
| 362 | } never executed: end of block | 0 |
| 363 | free(db->qual); | - |
| 364 | if (db->data != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 365 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 366 | ) { | - |
| 367 | for (i = sk_num(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0))) - 1; i >= 0| TRUE | never evaluated | | FALSE | never evaluated |
; i--) { | 0 |
| 368 | | - |
| 369 | | - |
| 370 | p = ((OPENSSL_PSTRING)sk_value(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0)), i)); | - |
| 371 | max = p[db->num_fields]; | - |
| 372 | if (max == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 373 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 374 | ) | - |
| 375 | { | - |
| 376 | for (n = 0; n < db->num_fields| TRUE | never evaluated | | FALSE | never evaluated |
; n++) | 0 |
| 377 | free(p[n]); never executed: free(p[n]); | 0 |
| 378 | } never executed: end of block else { | 0 |
| 379 | for (n = 0; n < db->num_fields| TRUE | never evaluated | | FALSE | never evaluated |
; n++) { | 0 |
| 380 | if (((| TRUE | never evaluated | | FALSE | never evaluated |
p[n] < (char *)p)| TRUE | never evaluated | | FALSE | never evaluated |
|| | 0 |
| 381 | (| TRUE | never evaluated | | FALSE | never evaluated |
p[n] > max)| TRUE | never evaluated | | FALSE | never evaluated |
) && | 0 |
| 382 | (| TRUE | never evaluated | | FALSE | never evaluated |
p[n] != | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 383 | ((void *)0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 384 | )| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 385 | free(p[n]); never executed: free(p[n]); | 0 |
| 386 | } never executed: end of block | 0 |
| 387 | } never executed: end of block | 0 |
| 388 | free(((OPENSSL_PSTRING)sk_value(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0)), i))); | - |
| 389 | } never executed: end of block | 0 |
| 390 | sk_free(((_STACK*) (1 ? db->data : (struct stack_st_OPENSSL_PSTRING*)0))); | - |
| 391 | } never executed: end of block | 0 |
| 392 | free(db); | - |
| 393 | } never executed: end of block | 0 |
| | |