mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-07-01 22:47:10 +02:00
- memset is disabled for now as it causes hangs - underlying functions were copied from isoalloc, licensed Apache-2.0 - credit Chris Rohlf for memcpy/memset - credit David Carlier for memmove - use the fast path as some programs crash otherwise Signed-off-by: Tavi <tavi@divested.dev>
15 lines
322 B
C
15 lines
322 B
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "test_util.h"
|
|
|
|
OPTNONE int main(void) {
|
|
char *firstbuffer = malloc(16);
|
|
char *secondbuffer = malloc(32);
|
|
if (!firstbuffer && !secondbuffer) {
|
|
return 1;
|
|
}
|
|
memset(secondbuffer, 'a', 16);
|
|
memcpy(firstbuffer, secondbuffer, 32);
|
|
return 1;
|
|
}
|