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

mbedtls_calloc fail #125

Closed
HamzaHajeir opened this issue Jun 11, 2023 · 1 comment
Closed

mbedtls_calloc fail #125

HamzaHajeir opened this issue Jun 11, 2023 · 1 comment

Comments

@HamzaHajeir
Copy link

HamzaHajeir commented Jun 11, 2023

Hi there,

I've found a possible bug wherein mbedtls is unable to allocate memory for its internals, maybe because of lack of configurations..

#include <Arduino.h>
#include "mbedtls/platform.h"
// put function declarations here:
void tryAlloc();

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  tryAlloc();
}

void loop() {
  // put your main code here, to run repeatedly:
}

void tryAlloc(){
	auto p = mbedtls_calloc(10,0);
	Serial.printf("mbedtls_calloc %s\n", p ? "SUCCEEDED" : "FAILED");
	if (p) {  mbedtls_free(p); }
}

PlatformIO configuration:

[env:esp32doit-devkit-v1]
platform = [email protected]
board = esp32doit-devkit-v1
framework = arduino
monitor_speed = 115200

Output:

mbedtls_calloc FAILED

@HamzaHajeir
Copy link
Author

I'm going to close the issue as it's proven not to be with build system, MCVE is wrong wherein the provided size=0.

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

No branches or pull requests

1 participant