Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uninitialized string buffer access in pilot cpp #627

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

sebholt
Copy link
Contributor

@sebholt sebholt commented Oct 8, 2024

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

This fixes access to uninitialized string buffers in pilot.cpp in two cases that are very similar.
From earlier commits an uninitialized string buffer remained but was used nonetheless in logging functions where
a std::string, that was introduced meanwhile, should have been used instead.

This fixes both cases and removes the now unused string buffer.

Related Issues

Screenshots (if applicable)

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

Additional Comments

@sebholt sebholt changed the title Fix pilot cpp Fix uninitialized string buffer access in pilot cpp Oct 8, 2024
Descent3/pilot.cpp Outdated Show resolved Hide resolved
The string buffer was used to obtain the file name but that was later replaced
by a std::string.  What remained was the uninitialized buffer that was fed
to logging functions where the std::string should have been used instead.

This removes the obsolete buffer and feeds the std::string to the logging
functions.
The string buffer was used to obtain the file name but that was later replaced
by a std::string.  What remained was the uninitialized buffer that was fed
to logging functions where the std::string should have been used instead.

This removes the obsolete buffer and feeds the std::string to the logging
functions.
@pzychotic pzychotic merged commit 89b5a80 into DescentDevelopers:main Oct 9, 2024
10 checks passed
@sebholt sebholt deleted the fix_pilot_cpp branch October 9, 2024 18:37
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