Closed
Description
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
libssh: free sftp_canonicalize_path() data correctly
libssh: free sftp_canonicalize_path() data correctly