Skip to content

Conversation

@PythonGermany
Copy link
Owner

Fixes https://github.com/PythonGermany/42_webserv/security/code-scanning/3

To fix the problem, we need to replace the call to std::gmtime with std::gmtime_r. This change ensures that the tm structure is allocated by the caller, making the function call thread-safe.

  • We will modify the getTime function to use std::gmtime_r instead of std::gmtime.
  • We will allocate a tm structure on the stack and pass its pointer to std::gmtime_r.
  • This change will be made in the file src/utils/utils.cpp at the relevant lines.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@PythonGermany
Copy link
Owner Author

gmtime_r was added in c23

@PythonGermany PythonGermany deleted the alert-autofix-3 branch October 29, 2024 19:43
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.

2 participants