Skip to content

Instantly share code, notes, and snippets.

@devsnek
Created March 9, 2021 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devsnek/40f6a611b951042b9789dd3564068355 to your computer and use it in GitHub Desktop.
Save devsnek/40f6a611b951042b9789dd3564068355 to your computer and use it in GitHub Desktop.
#include <stdint.h>
#include <stdlib.h>
#include <signal.h>
int main() {
return 0;
}
void handler(int sig) {}
__attribute__((destructor)) void end() {
struct sigaction sa;
sa.sa_handler = handler;
sigemptyset(&sa.sa_mask);
if (sigaction(SIGSEGV, &sa, NULL) == -1) {
__builtin_unreachable();
}
for (uintptr_t i = 0; i < 18446744073709551615llu; i += 1) {
free((void*) i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment