File tree Expand file tree Collapse file tree 5 files changed +97
-0
lines changed Expand file tree Collapse file tree 5 files changed +97
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ #ifndef _WIN32
4+ # include <pwd.h>
5+
6+ int main ()
7+ {
8+ const char * user = "user" ;
9+ struct passwd * result = getpwnam (user );
10+ (void )* result ;
11+ return 0 ;
12+ }
13+ #else
14+ int main ()
15+ {
16+ }
17+ #endif
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --pointer-check --bounds-check
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
7+ --
8+ ^warning: ignoring
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ #ifndef _WIN32
4+ # include <pwd.h>
5+
6+ int main ()
7+ {
8+ struct passwd * result = getpwuid (0 );
9+ (void )* result ;
10+ return 0 ;
11+ }
12+ #else
13+ int main ()
14+ {
15+ }
16+ #endif
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --pointer-check --bounds-check
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
7+ --
8+ ^warning: ignoring
Original file line number Diff line number Diff line change 1+ /* FUNCTION: getpwnam */
2+
3+ #ifndef _WIN32
4+
5+ # ifndef __CPROVER_PWD_H_INCLUDED
6+ # include <pwd.h>
7+ # define __CPROVER_PWD_H_INCLUDED
8+ # endif
9+
10+ unsigned __VERIFIER_nondet_unsigned (void );
11+
12+ struct passwd __CPROVER_passwd ;
13+
14+ struct passwd * getpwnam (const char * name )
15+ {
16+ // make some fields non-null
17+ __CPROVER_passwd .pw_name = (char * )name ;
18+ __CPROVER_passwd .pw_uid = __VERIFIER_nondet_unsigned ();
19+ __CPROVER_passwd .pw_gid = __VERIFIER_nondet_unsigned ();
20+ return & __CPROVER_passwd ;
21+ }
22+
23+ #endif
24+
25+ /* FUNCTION: getpwuid */
26+
27+ #ifndef _WIN32
28+
29+ # ifndef __CPROVER_PWD_H_INCLUDED
30+ # include <pwd.h>
31+ # define __CPROVER_PWD_H_INCLUDED
32+ # endif
33+
34+ unsigned __VERIFIER_nondet_unsigned (void );
35+
36+ # ifndef LIBRARY_CHECK
37+ struct passwd __CPROVER_passwd ;
38+ # endif
39+
40+ struct passwd * getpwuid (uid_t uid )
41+ {
42+ // make some fields non-null
43+ __CPROVER_passwd .pw_uid = uid ;
44+ __CPROVER_passwd .pw_gid = __VERIFIER_nondet_unsigned ();
45+ return & __CPROVER_passwd ;
46+ }
47+
48+ #endif
You can’t perform that action at this time.
0 commit comments