Skip to content

bump version to 1.84#89

Closed
damachine wants to merge 4 commits intomainfrom
alert-fix-546
Closed

bump version to 1.84#89
damachine wants to merge 4 commits intomainfrom
alert-fix-546

Conversation

@damachine
Copy link
Owner

No description provided.

@damachine damachine enabled auto-merge (squash) October 11, 2025 16:00
// Check if file exists and is readable
FILE *file = fopen(path, "r");
// Sicheres Öffnen der Konfigurationsdatei
int cfd = open(path, O_RDONLY | O_NOFOLLOW);

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

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).
// Try to read from VERSION file
FILE *fp = fopen("VERSION", "r");
// Try to read from VERSION file sicher
int vfd = open("VERSION", O_RDONLY | O_NOFOLLOW);

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

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).
{
// Try alternative path for installed version
fp = fopen("/opt/coolerdash/VERSION", "r");
vfd = open("/opt/coolerdash/VERSION", O_RDONLY | O_NOFOLLOW);

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

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).
FILE *image_file = fopen(shutdown_image_path, "r");
if (image_file)
// Check if shutdown image file exists and is a regular file
int img_fd = open(shutdown_image_path, O_RDONLY | O_NOFOLLOW);

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

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).
FILE *file = NULL;
if (cfd != -1)
{
struct stat cst;

Check notice

Code scanning / Cppcheck (reported by Codacy)

stat is Y2038-unsafe Note

stat is Y2038-unsafe
if (cfd != -1)
{
struct stat cst;
if (fstat(cfd, &cst) == 0 && S_ISREG(cst.st_mode))

Check notice

Code scanning / Cppcheck (reported by Codacy)

fstat is Y2038-unsafe Note

fstat is Y2038-unsafe
if (cfd != -1)
{
struct stat cst;
if (fstat(cfd, &cst) == 0 && S_ISREG(cst.st_mode))

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
FILE *fp = NULL;
if (vfd != -1)
{
struct stat vst;

Check notice

Code scanning / Cppcheck (reported by Codacy)

stat is Y2038-unsafe Note

stat is Y2038-unsafe
if (vfd != -1)
{
struct stat vst;
if (fstat(vfd, &vst) == 0 && S_ISREG(vst.st_mode))

Check notice

Code scanning / Cppcheck (reported by Codacy)

fstat is Y2038-unsafe Note

fstat is Y2038-unsafe
fclose(image_file);
send_image_to_lcd(g_config_ptr, shutdown_image_path, device_uid);
send_image_to_lcd(g_config_ptr, shutdown_image_path, device_uid); // Send twice for better reliability
struct stat img_st;

Check notice

Code scanning / Cppcheck (reported by Codacy)

stat is Y2038-unsafe Note

stat is Y2038-unsafe
send_image_to_lcd(g_config_ptr, shutdown_image_path, device_uid);
send_image_to_lcd(g_config_ptr, shutdown_image_path, device_uid); // Send twice for better reliability
struct stat img_st;
if (fstat(img_fd, &img_st) == 0 && S_ISREG(img_st.st_mode))

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.1 rule Note

MISRA 12.1 rule
send_image_to_lcd(g_config_ptr, shutdown_image_path, device_uid);
send_image_to_lcd(g_config_ptr, shutdown_image_path, device_uid); // Send twice for better reliability
struct stat img_st;
if (fstat(img_fd, &img_st) == 0 && S_ISREG(img_st.st_mode))

Check notice

Code scanning / Cppcheck (reported by Codacy)

fstat is Y2038-unsafe Note

fstat is Y2038-unsafe
// Not a regular file
close(img_fd);
log_message(LOG_WARNING, "Shutdown image '%s' ist kein reguläres File oder nicht lesbar", shutdown_image_path);
goto shutdown_image_missing;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.1 rule Note

MISRA 15.1 rule
// Not a regular file
close(img_fd);
log_message(LOG_WARNING, "Shutdown image '%s' ist kein reguläres File oder nicht lesbar", shutdown_image_path);
goto shutdown_image_missing;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 15.3 rule Note

MISRA 15.3 rule
@damachine damachine disabled auto-merge October 11, 2025 16:03
@damachine damachine closed this Oct 11, 2025
@damachine damachine deleted the alert-fix-546 branch October 11, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant