fix: few UBs; fix: missing error handler for malloc

This commit fixes some few UBs (Undefined Behaviors) based on numerous sanitizers, and also adds the missing error handling for a "malloc" call.
This commit is contained in:
ThePedroo
2024-10-05 15:31:37 -03:00
parent e11db94002
commit 0352d9378b
5 changed files with 27 additions and 6 deletions
+5 -1
View File
@@ -9,7 +9,11 @@
#include "kernelsu.h"
#define KERNEL_SU_OPTION 0xdeadbeef
/* INFO: It would be presumed it is a unsigned int,
so we need to cast it to signed int to
avoid any potential UB.
*/
#define KERNEL_SU_OPTION (signed int)0xdeadbeef
#define CMD_GET_VERSION 2
#define CMD_UID_GRANTED_ROOT 12