From 94a6f6282fb801825c9742f4b41c24972d0cc51b Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Wed, 6 Apr 2022 11:59:23 +0100 Subject: [PATCH] Fixes a stream overflow in the test suite This is triggered when xrdp is built with --enable-devel-logging Also, the logging sub-system is initialised for libxrdp tests --- tests/libxrdp/test_libxrdp_main.c | 9 +++++++++ tests/libxrdp/test_libxrdp_process_monitor_stream.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/libxrdp/test_libxrdp_main.c b/tests/libxrdp/test_libxrdp_main.c index 370c092c..a2af4854 100644 --- a/tests/libxrdp/test_libxrdp_main.c +++ b/tests/libxrdp/test_libxrdp_main.c @@ -4,6 +4,7 @@ #include #include +#include "log.h" #include "test_libxrdp.h" int main (void) @@ -15,8 +16,16 @@ int main (void) srunner_add_suite(sr, make_suite_test_monitor_processing()); srunner_set_tap(sr, "-"); + + /* + * Set up console logging */ + struct log_config *lc = log_config_init_for_console(LOG_LEVEL_INFO, NULL); + log_start_from_param(lc); + log_config_free(lc); + srunner_run_all (sr, CK_ENV); number_failed = srunner_ntests_failed(sr); srunner_free(sr); + log_end(); return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; } diff --git a/tests/libxrdp/test_libxrdp_process_monitor_stream.c b/tests/libxrdp/test_libxrdp_process_monitor_stream.c index cc2b6ef9..1e423874 100644 --- a/tests/libxrdp/test_libxrdp_process_monitor_stream.c +++ b/tests/libxrdp/test_libxrdp_process_monitor_stream.c @@ -146,7 +146,7 @@ START_TEST(test_libxrdp_process_monitor_stream__with_sextuple_monitor_happy_path { struct stream *s = (struct stream *)NULL; make_stream(s); - init_stream(s, 233); + init_stream(s, 8192); out_uint32_le(s, 6); //monitorCount