OpenCoverage

LPdir_unix.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/LPdir_unix.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4struct OPENSSL_dir_context_st {-
5 DIR *dir;-
6 char entry_name[-
7 4096 -
8 + 1];-
9-
10-
11-
12-
13};-
14-
15const char *OPENSSL_DIR_read(OPENSSL_DIR_CTX **ctx, const char *directory)-
16{-
17 struct dirent *direntry = -
18 ((void *)0)-
19 ;-
20-
21 if (ctx ==
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80643
22 ((void *)0)
ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80643
23 || directory ==
directory == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80643
24 ((void *)0)
directory == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 80643 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-80643
25 ) {-
26 -
27 (*__errno_location ()) -
28 = -
29 22-
30 ;-
31 return
never executed: return 0;
0;
never executed: return 0;
0
32 }-
33-
34 -
35 (*__errno_location ()) -
36 = 0;-
37 if (*
*ctx == ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80450 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx ==
*ctx == ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80450 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
193-80450
38 ((void *)0)
*ctx == ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80450 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
193-80450
39 ) {-
40 *ctx = malloc(sizeof(**ctx));-
41 if (*
*ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx ==
*ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-193
42 ((void *)0)
*ctx == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-193
43 ) {-
44 -
45 (*__errno_location ()) -
46 = -
47 12-
48 ;-
49 return
never executed: return 0;
0;
never executed: return 0;
0
50 }-
51 memset(*ctx, 0, sizeof(**ctx));-
52 (*ctx)->dir = opendir(directory);-
53 if ((*
(*ctx)->dir == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
ctx)->dir ==
(*ctx)->dir == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-193
54 ((void *)0)
(*ctx)->dir == ((void *)0)Description
TRUEnever evaluated
FALSEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
0-193
55 ) {-
56 int save_errno = -
57 (*__errno_location ())-
58 ;-
59 free(*ctx);-
60 *ctx = -
61 ((void *)0)-
62 ;-
63 -
64 (*__errno_location ()) -
65 = save_errno;-
66 return
never executed: return 0;
0;
never executed: return 0;
0
67 }-
68 }
executed 193 times by 1 test: end of block
Executed by:
  • libcrypto.so.1.1
193
69 direntry = readdir((*ctx)->dir);-
70 if (direntry ==
direntry == ((void *)0)Description
TRUEevaluated 142 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80501 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
142-80501
71 ((void *)0)
direntry == ((void *)0)Description
TRUEevaluated 142 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEevaluated 80501 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
142-80501
72 ) {-
73 return
executed 142 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
0;
executed 142 times by 1 test: return 0;
Executed by:
  • libcrypto.so.1.1
142
74 }-
75-
76 -
77 __builtin_strncpy (-
78 (*ctx)->entry_name-
79 , -
80 direntry->d_name-
81 , -
82 sizeof((*ctx)->entry_name) - 1-
83 )-
84 -
85 ;-
86 (*ctx)->entry_name[sizeof((*ctx)->entry_name) - 1] = '\0';-
87 return
executed 80501 times by 1 test: return (*ctx)->entry_name;
Executed by:
  • libcrypto.so.1.1
(*ctx)->entry_name;
executed 80501 times by 1 test: return (*ctx)->entry_name;
Executed by:
  • libcrypto.so.1.1
80501
88}-
89-
90int OPENSSL_DIR_end(OPENSSL_DIR_CTX **ctx)-
91{-
92 if (ctx !=
ctx != ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-193
93 ((void *)0)
ctx != ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-193
94 && *
*ctx != ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
ctx !=
*ctx != ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-193
95 ((void *)0)
*ctx != ((void *)0)Description
TRUEevaluated 193 times by 1 test
Evaluated by:
  • libcrypto.so.1.1
FALSEnever evaluated
0-193
96 ) {-
97 int ret = closedir((*ctx)->dir);-
98-
99 free(*ctx);-
100 switch (ret) {-
101 case
executed 193 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
0:
executed 193 times by 1 test: case 0:
Executed by:
  • libcrypto.so.1.1
193
102 return
executed 193 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
1;
executed 193 times by 1 test: return 1;
Executed by:
  • libcrypto.so.1.1
193
103 case
never executed: case -1:
-1:
never executed: case -1:
0
104 return
never executed: return 0;
0;
never executed: return 0;
0
105 default
never executed: default:
:
never executed: default:
0
106 break;
never executed: break;
0
107 }-
108 }-
109 -
110 (*__errno_location ()) -
111 = -
112 22-
113 ;-
114 return
never executed: return 0;
0;
never executed: return 0;
0
115}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2