Conversation
| */ | ||
| static FILE *try_open_version_file(const char *path) | ||
| { | ||
| int fd = open(path, O_RDONLY); |
Check warning
Code scanning / Flawfinder (reported by Codacy)
Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). Warning
| int fd = open(path, O_RDONLY); | ||
| if (fd == -1) | ||
| { | ||
| return NULL; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| } | ||
|
|
||
| struct stat version_stat; | ||
| if (fstat(fd, &version_stat) != 0 || !S_ISREG(version_stat.st_mode)) |
Check notice
Code scanning / Cppcheck (reported by Codacy)
fstat is Y2038-unsafe Note
| } | ||
|
|
||
| struct stat version_stat; | ||
| if (fstat(fd, &version_stat) != 0 || !S_ISREG(version_stat.st_mode)) |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 12.1 rule Note
| if (fstat(fd, &version_stat) != 0 || !S_ISREG(version_stat.st_mode)) | ||
| { | ||
| close(fd); | ||
| return NULL; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
| close(fd); | ||
| return NULL; | ||
| } | ||
|
|
Check notice
Code scanning / Cppcheck (reported by Codacy)
stat is Y2038-unsafe Note
| remove_pid_file(config.paths_pid); | ||
| return EXIT_FAILURE; | ||
| print_coolercontrol_troubleshooting(config); | ||
| return -1; |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 15.5 rule Note
|
|
||
| // Get complete device info from cache (no API call) | ||
| if (get_liquidctl_data(&config, device_uid, sizeof(device_uid), | ||
| if (get_liquidctl_data(config, device_uid, sizeof(device_uid), |
Check notice
Code scanning / Cppcheck (reported by Codacy)
MISRA 14.4 rule Note
No description provided.