1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00

libssh2.h: add two FIXMEs for allocator requirements

`LIBSSH2_USERAUTH_KBDINT_PROMPT` and `LIBSSH2_USERAUTH_KBDINT_RESPONSE`
have a `text` pointer which require using the default system allocator
by the API user, as documented in
`docs/libssh2_userauth_keyboard_interactive_ex.md`.

To align with `libssh2_userauth_publickey_sk()` and best-practices, add
FIXMEs to replace this requirement to use `LIBSSH2_ALLOC_FUNC` for the
custom allocator set via `libssh2_session_init_ex()` (or, if not set use
the default system allocator.)

The above fix requires an ABI break, or a replacement parallel API that
fixes this issue.

Reported-by: Makise Kurisu
Ref: GHSA-p6p8-66vc-3f24

Closes #2659
This commit is contained in:
Viktor Szakats
2026-10-07 13:13:32 +02:00
parent 77e54d8320
commit ce631aafe1

View File

@@ -218,14 +218,14 @@ typedef off_t libssh2_struct_stat_size;
#endif
typedef struct _LIBSSH2_USERAUTH_KBDINT_PROMPT
{
unsigned char *text;
unsigned char *text; /* FIXME: require LIBSSH2_ALLOC_FUNC */
size_t length;
unsigned char echo;
} LIBSSH2_USERAUTH_KBDINT_PROMPT;
typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
{
char *text;
char *text; /* FIXME: require LIBSSH2_ALLOC_FUNC */
unsigned int length; /* FIXME: change type to size_t */
} LIBSSH2_USERAUTH_KBDINT_RESPONSE;