mirror of
https://github.com/libssh2/libssh2.git
synced 2026-10-24 03:48:58 +03:00
1f977e77f5d5c89171f6f641ca162e6edc92fc6c
libssh2_agent_*() API functions
All public API functions in `src/agent.c` that take a `LIBSSH2_AGENT *` were missing a NULL-pointer check at entry. A caller that passes NULL (for example, after `libssh2_agent_init()` returns NULL due to OOM) immediately dereferences the null pointer and crashes. Every other source file in this tree already has the pattern: `channel.c`, `sftp.c`, `session.c`, `userauth.c`, and `knownhost.c` all guard their primary handle before touching any field. `agent.c` was the only outlier. Add `if(!agent)` guards consistent with the style used in the rest of the codebase. Closes #2635
libssh2 - SSH2 library
libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.
Installation instructions:
Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Languages
C
84.2%
CMake
3.7%
Perl
3.2%
M4
2.7%
Shell
2.3%
Other
3.7%