mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
log: fixes legacy fallback for multiple sessions.
Legacy code in 'ssh_set_callbacks' will fallback to 'ssh_legacy_log_callback' (if the current log cb is NULL) setting the user data to the current session. However, if any other session is created afterwards, it won't update the user data with the new session, potentially leading to a use-after-free. Fixes #238. Signed-off-by: Diego Roux <diegoroux04@protonmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -274,6 +274,10 @@ void ssh_log_common(struct ssh_common_struct *common,
|
||||
const char *function,
|
||||
const char *format, ...) PRINTF_ATTRIBUTE(4, 5);
|
||||
|
||||
void _ssh_remove_legacy_log_cb(void);
|
||||
|
||||
/* log.c */
|
||||
void _ssh_reset_log_cb(void);
|
||||
|
||||
/* ERROR HANDLING */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user