Skip to content

libssh backend and homedir memory handling #3402

Closed
@bagder

Description

@bagder

I did this

I did a debug-build of curl built with the libssh backend and ran the test suite.

I expected the following

I ran into issues because it turns out we try to free the pointer that libssh has returned from its sftp_canonicalize_path function.

All memory allocations in a debug build are subject for extra handling and thus it cannot easily mix with memory allocated without the debug-layer. But when I instead changed to use the "real" free() directly on this pointer, that also caused crashes. I could only make it run fine by completely avoiding the free of that data!

I reported the lack of docs for this function to the libssh project.

curl/libcurl version

curl 7.64.0-DEV (x86_64-pc-linux-gnu) libcurl/7.64.0-DEV (GnuTLS/3.6.5) OpenSSL/1.1.1a zlib/1.2.11 brotli/1.0.7 c-ares/1.14.0 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.8.5/openssl/zlib nghttp2/1.35.0-DEV librtmp/2.3

operating system

(unstable) Debian Linux, got the libssh version from the regular debian repo.

Activity

added 2 commits that reference this issue on Dec 21, 2018
6ec3b69
976b7bf
locked as resolved and limited conversation to collaborators on Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bagder

        Issue actions

          libssh backend and homedir memory handling · Issue #3402 · curl/curl