Unused Value at home-expand.c:18 |
No properties have been set. edit properties |
Jump to warning location ↓ | warning details... |
| |
home_try_expand (/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/home-expand.c)![]() | ||||||
![]() | ||||||
9 | int (const char **_path) | |||||
10 | { | |||||
11 | const char *path = *_path; | |||||
12 | const char *home, *p, *orig_path; | |||||
13 | struct passwd *pw; | |||||
14 | ||||||
15 | if (path == NULL || *path != '~') | |||||
16 | return 0; | |||||
17 | ||||||
18 | orig_path = path++;
| |||||
19 | if (*path == '/' || *path == '\0') { | |||||
20 | home = getenv("HOME"); | |||||
21 | if (*path != '\0') path++; | |||||
22 | } else { | |||||
23 | p = strchr(path, '/'); | |||||
24 | if (p == NULL) { | |||||
25 | pw = getpwnam(path); | |||||
26 | path = ""; | |||||
27 | } else { | |||||
28 | pw = getpwnam(t_strdup_until(path, p)); | |||||
29 | path = p+1; | |||||
30 | } | |||||
31 | ||||||
32 | home = pw == NULL ? NULL : pw->pw_dir; | |||||
33 | } | |||||
34 | ||||||
35 | if (home == NULL) | |||||
36 | return -1; | |||||
37 | ||||||
38 | if (*path == '\0') | |||||
39 | *_path = t_strdup(home); | |||||
40 | else | |||||
41 | *_path = t_strconcat(home, "/", path, NULL); | |||||
42 | return 0; | |||||
43 | } | |||||
![]() |