Browse Source

clear freed memory in u_free_impl to catch UAF earlier

congestion
Evgeny 4 months ago
parent
commit
4e6d57e371
  1. 2
      lib/mem.c

2
lib/mem.c

@ -233,6 +233,8 @@ void u_free_impl(void* ptr, const char* location) {
#endif #endif
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
uint32_t total = size + 12 + 2 * BOUNDARY_CHECK_SIZE + METADATA_SIZE;
memset(base, 0, total);
free(base); free(base);
} }

Loading…
Cancel
Save