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: prevent segfault in gvm_ssh_public_from_private #817

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

mattmundell
Copy link
Contributor

What

Prevent a segfault in gvm_ssh_public_from_private when calling GMP GET_CREDENTIALS with format="key".

Why

Segfault bad.

Reproduce

Create a password credential.

o m m '<create_credential><name>segf</name><login>segf</login><password>segf</password></create_credential>'

Get the credential with format key:

o m m '<get_credentials format="key" filter="name=segf"/>'

Before the PR the response is empty and this happens in the log:

md manage:MESSAGE:2024-05-13 13h48.53 EDT:588564: Received Segmentation fault signal
md   main:MESSAGE:2024-05-13 13h49.25 EDT:588625: BACKTRACE: gvmd: Serving client(+0x70026) [0x5555555c4026]

After the PR the log is clear and the response is good:

<get_credentials_response status="200" status_text="OK">
  <credential id="85a3848c-1890-4bf0-835e-bed8a6af691d">
    ...

@mattmundell mattmundell requested a review from a team as a code owner May 13, 2024 18:00
@mattmundell mattmundell merged commit 0bc8aa5 into main Jun 3, 2024
10 checks passed
@mattmundell mattmundell deleted the get-credentials-segf branch June 3, 2024 14:44
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