Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always define XREALLOC for FreeRTOS. #7254

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kareem-wolfssl
Copy link
Contributor

Description

Fixes zd# 17269

XREALLOC is used throughout our code, so it should always be defined rather than only when USE_INTEGER_HEAP_MATH or OPENSSL_EXTRA are defined.

@@ -1045,7 +1045,7 @@ extern void uITRON4_free(void *p) ;
#define XREALLOC(p, n, h, t) ((void)(h), (void)(t), realloc((p), (n)))
/* FreeRTOS pvPortRealloc() implementation can be found here:
* https://github.com/wolfSSL/wolfssl-freertos/pull/3/files */
#elif defined(USE_INTEGER_HEAP_MATH) || defined(OPENSSL_EXTRA)
#else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pvPortRealloc is not a standard FREERTOS function. We can't force users to support it. Our library will/should fallback to an XMALLOC/XFREE when XREALLOC is not defined. If we have an issue with XREALLOC being expected let's fix that instead please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I will work on updating the check. The issue is basically that we are using XREALLOC in multiple spots in our code where OPENSSL_EXTRA/USE_INTEGER_HEAP_MATH are not required, so the include guard will need to be updated.
I do not see any fallback to XMALLOC/XFREE for this case currently, in the ticket the customer is running into a compilation error because XREALLOC was not defined when it was expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, those two options no longer cover the various cases. Search for internal.c and ssl.c for #ifndef XREALLOC and you'll see the pattern.

@dgarske dgarske removed the request for review from wolfSSL-Bot May 15, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants