gvm-libs icon indicating copy to clipboard operation
gvm-libs copied to clipboard

Fix: prevent segfault in gvm_ssh_public_from_private

Open mattmundell opened this issue 1 year ago • 0 comments

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 avatar May 13 '24 18:05 mattmundell