1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
filtede98 1f977e77f5 agent: add NULL guards to all public 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
2026-10-02 18:57:37 +02:00
2026-09-13 16:12:32 +02:00
2026-09-13 16:12:32 +02:00
2026-04-10 18:39:11 +02:00
2026-09-14 11:22:52 +02:00
2023-06-07 08:18:55 +02:00
2011-04-04 13:31:33 +02:00

libssh2 - SSH2 library

libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.

Web site

Mailing list

BSD Licensed

Web site source code

Installation instructions:

Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Readme 26 MiB
Languages
C 84.2%
CMake 3.7%
Perl 3.2%
M4 2.7%
Shell 2.3%
Other 3.7%