You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
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:
@@ -54,6 +54,7 @@ void *entry_thread(void *arg) {
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
/* WARNING: Dynamic memory based */
|
||||
void entry(int fd) {
|
||||
LOGI("New companion entry.\n - Client fd: %d\n", fd);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -360,6 +360,7 @@ struct __attribute__((__packed__)) MsgHead {
|
||||
char data[0];
|
||||
};
|
||||
|
||||
/* WARNING: Dynamic memory based */
|
||||
void zygiskd_start(char *restrict argv[]) {
|
||||
LOGI("Welcome to ReZygisk %s Zygiskd!\n", ZKSU_VERSION);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user