mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-08-01 10:56:19 -04:00
Misc hardening from GrapheneOS
1162f81c237b
111f05db99ab
11f242089d3f
10abcf485dcf
9xc5db5a9f9e
Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
844227a4f4
commit
ad579b6681
6 changed files with 206 additions and 0 deletions
25
Patches/Common/android_system_bt/0001-alloc_size.patch
Normal file
25
Patches/Common/android_system_bt/0001-alloc_size.patch
Normal file
|
@ -0,0 +1,25 @@
|
|||
From abcf485dcff6c7b06b0f241b4729fc8e2cf1d74f Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Micay <danielmicay@gmail.com>
|
||||
Date: Sat, 1 Jul 2017 13:21:18 -0400
|
||||
Subject: [PATCH] add alloc_size attributes to the allocator
|
||||
|
||||
This results in expanded _FORTIFY_SOURCE coverage.
|
||||
---
|
||||
osi/include/allocator.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/osi/include/allocator.h b/osi/include/allocator.h
|
||||
index 3a4141f384..4fa059eb14 100644
|
||||
--- a/osi/include/allocator.h
|
||||
+++ b/osi/include/allocator.h
|
||||
@@ -37,8 +37,8 @@ extern const allocator_t allocator_calloc;
|
||||
char* osi_strdup(const char* str);
|
||||
char* osi_strndup(const char* str, size_t len);
|
||||
|
||||
-void* osi_malloc(size_t size);
|
||||
-void* osi_calloc(size_t size);
|
||||
+void* osi_malloc(size_t size) __attribute__((alloc_size(1)));
|
||||
+void* osi_calloc(size_t size) __attribute__((alloc_size(1)));
|
||||
void osi_free(void* ptr);
|
||||
|
||||
// Free a buffer that was previously allocated with function |osi_malloc|
|
Loading…
Add table
Add a link
Reference in a new issue