mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-23 08:21:24 -04:00
perform size checks on various operations
Signed-off-by: Tavi <tavi@divested.dev> Co-authored-by: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
This commit is contained in:
parent
7481c8857f
commit
2f06cddeb7
46 changed files with 1166 additions and 13 deletions
15
test/wmemcpy_valid_same.c
Normal file
15
test/wmemcpy_valid_same.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <stdlib.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#include "test_util.h"
|
||||
|
||||
OPTNONE int main(void) {
|
||||
wchar_t *firstbuffer = malloc(16 * sizeof(wchar_t));
|
||||
wchar_t *secondbuffer = malloc(16 * sizeof(wchar_t));
|
||||
if (!firstbuffer && !secondbuffer) {
|
||||
return 1;
|
||||
}
|
||||
wmemset(secondbuffer, L'\U0001F642', 16);
|
||||
wmemcpy(firstbuffer, secondbuffer, 16);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue