Boosted by jsonstein@masto.deoan.org ("Jeff Sonstein"):
indivisibleteam ("Indivisible ❌👑") wrote:
SUNDAY: We’re offering a training on how to identify, defuse, and prevent the spread of political violence. By standing up in defense of democracy and in opposition to violence, we spread the courage for more to do so. https://www.mobilize.us/indivisible/event/844942/?utm%5Fsource=mastodon

![screenshot of enterprise_malloc.c, a 30-line file with the following contents: #define _GNU_SOURCE #include <dlfcn.h> #include <pthread.h> #include <stdlib.h> #define FREE_DELAY 100000 static void *free_delay_queue[FREE_DELAY]; static int free_delay_pos; static void (*orig_free)(void *); static void *(*orig_malloc)(size_t); static pthread_mutex_t free_delay_mutex = PTHREAD_MUTEX_INITIALIZER; void free(void *ptr) { if (!ptr) return; pthread_mutex_lock(&free_delay_mutex); if (!orig_free) orig_free = dlsym(RTLD_NEXT, "free"); orig_free(free_delay_queue[free_delay_pos]); free_delay_queue[free_delay_pos] = ptr; free_delay_pos++; free_delay_pos %= FREE_DELAY; pthread_mutex_unlock(&free_delay_mutex); } void *malloc(size_t sz) { pthread_mutex_lock(&free_delay_mutex); if (!orig_malloc) orig_malloc = dlsym(RTLD_NEXT, "malloc"); pthread_mutex_unlock(&free_delay_mutex); return orig_malloc (sz * 2 + 0x100); }](https://files.mastodon.social/cache/media_attachments/files/115/236/814/526/492/589/original/7bd4ecaa2613437e.png)






