|
From: | Florian Weimer |
Subject: | malloca, freea are not thread-safe |
Date: | Wed, 10 Jan 2018 15:02:17 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
#define HASH_TABLE_SIZE 257 static void * mmalloca_results[HASH_TABLE_SIZE]; … mmalloca (size_t n) { … /* Enter p into the hash table. */ slot = (uintptr_t) p % HASH_TABLE_SIZE; h->next = mmalloca_results[slot]; mmalloca_results[slot] = p;freea also causes valgrind warnings because it contains an out-of-bounds access. This is very undesirable because it will cause programmers to miss real bugs.
This code has been copied into libunistring and results in a thread safety hazard there.
Thanks, Florian
[Prev in Thread] | Current Thread | [Next in Thread] |