Skip to content

Update log.c - #4

Open
KenBot117 wants to merge 1 commit into
CameronLonsdale:masterfrom
KenBot117:master
Open

KenBot117 wants to merge 1 commit into
CameronLonsdale:masterfrom
KenBot117:master

Conversation

@KenBot117

Copy link
Copy Markdown

sys_nerr and sys_errlist depricated. Now using errno and strerror()

I still ran into some build errors that required sgml2latex which I got from linuxdoc-tools.
This time it actually asked for latex so I installed latex-make.
This allowed the build to complete. I suspect one would only need latex-make and gcc-multilib to complete this build.

This is my fix to issue 3 and I'm not sure if there's a simple way (or much how to on my side yet) to update the requirements list.

sys_nerr and sys_errlist depricated. Now using errno and strerror()
@dryrunsecurity

dryrunsecurity Bot commented Nov 8, 2024

Copy link
Copy Markdown

DryRun Security Summary

The code change in this pull request updates the mft_log_perror() function to use the more modern and recommended errno check instead of the outdated sys_nerr check, improving the reliability and security of the logging functionality.

Expand for full summary

Summary:

The code change in this pull request appears to be a fix for a potential issue in the mft_log_perror() function. The original code checked if the error number (eno) was greater than sys_nerr, which is an outdated way of checking the validity of an error number. The updated code now checks if the error number is greater than errno, which is the more modern and recommended way to check the validity of an error number.

From an application security perspective, this change is a positive improvement, as it addresses a potential issue that could lead to unexpected behavior or even security vulnerabilities. Additionally, the updated code now uses the strerror() function to retrieve the error message corresponding to the error number, which is a more robust and secure approach compared to directly accessing the sys_errlist array, which is considered a deprecated practice. Overall, this code change appears to be a security-focused improvement that enhances the reliability and robustness of the logging functionality in the application.

Files Changed:

  • mft/log.c: The code change in this file updates the mft_log_perror() function to use the more modern and recommended errno check instead of the outdated sys_nerr check. This change improves the reliability and security of the logging functionality by ensuring that the error number is properly validated and that the corresponding error message is retrieved using the strerror() function.

Code Analysis

We ran 9 analyzers against 1 file and 0 analyzers had findings. 9 analyzers had no findings.

Riskiness

🟢 Risk threshold not exceeded.

View PR in the DryRun Dashboard.

@KenBot117 KenBot117 mentioned this pull request Nov 8, 2024
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