add: error handling for UpdateMountNamespace

This commit adds the missing error handling for "UpdateMountNamespace" in both libzygisk.so and ReZygiskd, as before it would send a -1 as unsigned, leading to issues.
This commit is contained in:
ThePedroo
2025-04-25 02:02:29 -03:00
parent a460c54d08
commit a4c9794de0
2 changed files with 19 additions and 2 deletions

View File

@@ -342,6 +342,14 @@ bool rezygiskd_update_mns(enum mount_namespace_state nms_state, char *buf, size_
return false;
}
if (target_fd == 0) {
LOGE("Failed to get target fd");
close(fd);
return false;
}
snprintf(buf, buf_size, "/proc/%u/fd/%u", target_pid, target_fd);
close(fd);