wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.23k stars 799 forks source link

wc_port.c: NETOS defined section: Fix typo. #7632

Closed skilau closed 1 month ago

skilau commented 1 month ago

This 1 line patch fixes a typo (or copy/paste error) in wc_port.c contained under a NETOS defined section.

TESTSUITE_THREAD_STACK_SZ is currently used in tx_thread_create() call for the size of the stack.

However, WOLFSSL_NETOS_STACK_SZ should be used instead.

The WOLFSSL_NETOS_STACK_SZ is used a few lines above to actually allocate the stack and its size, so the same value should be used to tell tx_thread_create() what the size of the stack is.

Description

This 1 line patch fixes a typo (or copy/paste error) in wc_port.c contained under the NETOS section.

TESTSUITE_THREAD_STACK_SZ is currently used in tx_thread_create() call for the size of the stack.

However, WOLFSSL_NETOS_STACK_SZ should be used instead.

The WOLFSSL_NETOS_STACK_SZ is used a few lines above to actually allocate the stack and its size, so the same value should be used to tell tx_thread_create() what the size of the stack is.

Fixes zd#

Testing

Without this change, the compile will fail when TESTSUITE_THREAD_STACK_SZ is not defined. (It is not required to be defined)

With this change, the compile succeeds, and with the proper values.

Checklist

wolfSSL-Bot commented 1 month ago

Can one of the admins verify this patch?

JacobBarthelmeh commented 1 month ago

Thanks @skilau for using wolfSSL and bringing up this issue! I don't see you listed on the contributor agreement list. Am going to consider this a bug report and implement a fix for it. If you have contributions in the future that you'd like added in, we're happy to get the contributor agreement process going through our support@wolfssl.com email channel.