summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiogo Ferreira <defer@cyngn.com>2015-01-07 13:11:53 +0000
committerDiogo Ferreira <defer@cyngn.com>2015-01-07 13:11:53 +0000
commit3e52b781ecc77b08f6bae9400d6508865d716d24 (patch)
tree62d63b331a3f8978a3f300fb2e4645875f42a285
parentb2ffaf24239b5b5ad9d6637c98285276d9fb8afb (diff)
downloadandroid_system_extras_su-3e52b781ecc77b08f6bae9400d6508865d716d24.tar.gz
android_system_extras_su-3e52b781ecc77b08f6bae9400d6508865d716d24.tar.bz2
android_system_extras_su-3e52b781ecc77b08f6bae9400d6508865d716d24.zip
su: Use the correct size for sockaddr structs
The binary was assuming that size(int) == sizeof(sockaddr) which is not true in some architectures such as arm64. Change-Id: I3cc3b2d3e8dc7f1c6cbede0dfbcd3b94e0bfaefc
-rw-r--r--daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index 1e40643..b58e1f6 100644
--- a/daemon.c
+++ b/daemon.c
@@ -301,7 +301,7 @@ static int daemon_accept(int fd) {
ALOGV("remote req pid: %d", daemon_from_pid);
struct ucred credentials;
- int ucred_length = sizeof(struct ucred);
+ socklen_t ucred_length = sizeof(struct ucred);
/* fill in the user data structure */
if(getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &credentials, &ucred_length)) {
ALOGE("could obtain credentials from unix domain socket");