From 6e629a51f897afbb7c5ba5947ab99855c26651d3 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 26 Sep 2018 08:16:58 -0700 Subject: [PATCH] Added test case for scenario where error is pushed, cleared then try to get current. Without fix to clear `wc_current_node` in `wc_ClearErrorNodes` this causes access to invalid/free'd memory. --- tests/api.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/api.c b/tests/api.c index c48a6dd23..a18b3ea7e 100644 --- a/tests/api.c +++ b/tests/api.c @@ -18391,6 +18391,11 @@ static void test_wolfSSL_ERR_put_error(void) /* Empty and free up all error nodes */ ERR_clear_error(); + /* Verify all nodes are cleared */ + ERR_put_error(0,SYS_F_ACCEPT, 0, "this file", 0); + ERR_clear_error(); + AssertIntEQ(ERR_get_error_line(&file, &line), 0); + printf(resultFmt, passed); #endif }