1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-28 01:41:48 +03:00

16 Commits

Author SHA1 Message Date
46a28cfc49 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>
2024-04-29 08:42:26 +02:00
7bd850ab36 Remove bogus semicolons
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-06-09 09:08:02 +02:00
0987e6065c Always check return value of ssh_list_new()
Another item identified during code review was cases where the return
value of ssh_list_new() was not properly checked and handled. This
updates all cases that were missing this to handle failure to allocate a
new list.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-12-11 13:35:20 +01:00
27caaa000b tests: Prefer assert_non_null() over assert_false()
This also replaces some occurrences of assert_true() with assert_null()

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-26 13:56:22 +01:00
f0ddde4826 Fix config.h includes
We need stdlib.h and string.h in priv.h for free() and memset().

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-10-28 14:31:37 +02:00
5437deed1b callbacks: Add support for MSVC
__typeof__ is GCC specific

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05 20:00:02 +01:00
fbe8ccdf3b tests: Fix memory leak in torture_callbacks
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04 08:33:33 +01:00
5c67530f1e tests: Add test for ssh_callbacks_iterate()
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02 16:56:50 +02:00
6f3a7d36bb tests: Add unit test for ssh_callbacks_execute_list
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02 16:56:25 +02:00
82a80b205b tests: Migrate to new cmocka API
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-07 10:40:12 +02:00
d42a1a35b0 tests: allow conditionnal execution on pattern
Option can be used to filter out irrelevant tests
usage: ./torture_pki '*ed25519'

Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02 17:34:15 +01:00
d9c47a8cfa tests: Add test for the logging function. 2014-06-10 13:52:20 +02:00
3f538b3ddd Call ssh_init()/ssh_finalize bf/af each testcase 2011-01-02 17:25:51 +01:00
5331489581 tests: Fixed the torture_callbacks test.
We should zero the structure else ssh_callback_exists() can't be
working.
2011-01-01 19:14:54 +01:00
400fc350a7 tests: Migrated torture_callbacks to cmockery. 2010-12-28 22:14:47 +01:00
94b00cc762 Add ssh_callbacks_exists internal macro + unittest
(first commit with eclipse helios, crossing fingers ...)
2010-06-25 16:19:19 +02:00