summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorGravatar Joshua Hill2015-12-29 22:27:17 +0100
committerGravatar Nikias Bassen2015-12-29 22:27:17 +0100
commitdf1f5c4d70d0c19ad40072f5246ca457e7f9849e (patch)
treee58b82edc3fcfb64f6df80c2a267879e85869232 /common
parentdecffad5f5a0320b1b6e9e8cda821534ba2ed0ca (diff)
downloadlibimobiledevice-df1f5c4d70d0c19ad40072f5246ca457e7f9849e.tar.gz
libimobiledevice-df1f5c4d70d0c19ad40072f5246ca457e7f9849e.tar.bz2
common: [security fix] Make sure sockets only listen locally
Diffstat (limited to 'common')
-rw-r--r--common/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/socket.c b/common/socket.c
index b276864..e2968a6 100644
--- a/common/socket.c
+++ b/common/socket.c
@@ -172,7 +172,7 @@ int socket_create(uint16_t port)
memset((void *) &saddr, 0, sizeof(saddr));
saddr.sin_family = AF_INET;
- saddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ saddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
saddr.sin_port = htons(port);
if (0 > bind(sfd, (struct sockaddr *) &saddr, sizeof(saddr))) {
@@ -329,7 +329,7 @@ int socket_accept(int fd, uint16_t port)
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(INADDR_ANY);
+ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
addr.sin_port = htons(port);
addr_len = sizeof(addr);