]> granicus.if.org Git - esp-idf/commitdiff
heap: Fix printf usage in heap poisoning
authorDarian Leung <darian@espressif.com>
Mon, 9 Sep 2019 13:56:39 +0000 (21:56 +0800)
committerDarian Leung <darian@espressif.com>
Mon, 9 Sep 2019 13:56:39 +0000 (21:56 +0800)
This commit fixes the bug where printf() is used in
verify_allocated_region() when ets_printf() should be used.

components/heap/multi_heap_poisoning.c

index dabf6cc24124d9ec7231d6eea88245083c9bd648..a896043abb6f7cad4623651526a7e01c47ed656a 100644 (file)
@@ -110,7 +110,7 @@ static poison_head_t *verify_allocated_region(void *data, bool print_errors)
     }
     if (canary != TAIL_CANARY_PATTERN) {
         if (print_errors) {
-            printf("CORRUPT HEAP: Bad tail at %p. Expected 0x%08x got 0x%08x\n", &tail->tail_canary,
+            MULTI_HEAP_STDERR_PRINTF("CORRUPT HEAP: Bad tail at %p. Expected 0x%08x got 0x%08x\n", &tail->tail_canary,
                    TAIL_CANARY_PATTERN, canary);
         }
         return NULL;