You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: free in garbage data pointer; fix: Zygiskd wrong message length
This commit fixes the issue where "free" would be executed in a pointer which has garbage data, leading to crashes. This was fixed by setting to NULL, so that it's clean. It also fixes the issue where Zygiskd messages for "DAEMON_SET_INFO" would not count the NULL-terminator, causing crashes.
This commit is contained in:
@@ -394,7 +394,7 @@ void zygiskd_start(char *restrict argv[]) {
|
||||
size_t msg_length = strlen("Root: , Modules: ") + strlen(impl_name) + module_list_len + 1;
|
||||
|
||||
struct MsgHead *msg = malloc(sizeof(struct MsgHead) + msg_length);
|
||||
msg->length = snprintf(msg->data, msg_length, "Root: %s, Modules: %s", impl_name, module_list);
|
||||
msg->length = snprintf(msg->data, msg_length, "Root: %s, Modules: %s", impl_name, module_list) + 1;
|
||||
msg->cmd = DAEMON_SET_INFO;
|
||||
|
||||
unix_datagram_sendto(CONTROLLER_SOCKET, (void *)msg, sizeof(struct MsgHead) + msg->length);
|
||||
|
||||
Reference in New Issue
Block a user