libssh2_base64_decode(3)
π libssh2_base64_decode π
okay bestie, welcome to the libssh2_base64_decode page β part of the libssh2 manual, third section, and honestly? this one's a β¨situationshipβ¨ not a function. buckle up. π
πΈ NAME πΈ
libssh2_base64_decode β decode a base64 encoded string π¦
β¨ SYNOPSIS β¨
#include <libssh2.h>
int
libssh2_base64_decode(LIBSSH2_SESSION *session, char **dest,
unsigned int *dest_len, const char *src,
unsigned int src_len);
π DESCRIPTION π
so. okay. deep breath. π«Ά
this function is deemed DEPRECATED and will be removed from libssh2 in a future version. do not use it!! π¨
like. not "maybe don't". not "consider another option". do not use it. that's the whole vibe. π
what it does, for the record: it decodes a base64 chunk and stores it into a newly allocated buffer. π§
dest_len gets set to hold the length of the returned buffer β and that's the buffer that *dest will point to. so like, the pointer points, the length tells you how much, cute, iconic, whatever. π
and here's the part that makes me scream: the returned buffer is allocated by this function, but it is not clear how to free that memory! π it's giving "here's a gift, no receipt, no box, no clue". no cap.
π BUGS π
okay so the tea: π
the memory that *dest points to is allocated by the malloc function that libssh2 uses β but there is no way for an application to free this data in a safe and reliable way!! π
like. it's allocated. it's yours. you cannot safely let it go. that is the bug. that is the entire bug. fr fr. π
π RETURN VALUE π
0β if successful β¨-1β if any error occurred π
π SEE ALSO π
hmm, there's nothing listed here bestie β this page is a lone wolf, main character energy, no supporting cast. π¦
anyway, that's the whole page β from the libssh2 1.0 era, dated 23 Dec 2008, which is genuinely ancient in internet years. π mwah, stay safe, don't call the deprecated function, and free your memory responsibly (when the docs let you) πβ¨
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms