libimobiledevice: fix CVE-2016-5104

This commit is contained in:
maxice8 2018-10-02 15:50:21 -03:00 committed by maxice8
parent f1faa09244
commit af3969db07
2 changed files with 34 additions and 1 deletions

View file

@ -0,0 +1,32 @@
From df1f5c4d70d0c19ad40072f5246ca457e7f9849e Mon Sep 17 00:00:00 2001
From: Joshua Hill <posixninja@gmail.com>
Date: Tue, 29 Dec 2015 22:27:17 +0100
Subject: [PATCH] common: [security fix] Make sure sockets only listen locally
---
common/socket.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/socket.c b/common/socket.c
index b276864e..e2968a64 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);

View file

@ -1,7 +1,8 @@
# Template file for 'libimobiledevice'
pkgname=libimobiledevice
version=1.2.0
revision=10
revision=11
patch_args="-Np1"
build_style=gnu-configure
hostmakedepends="automake libtool pkg-config python-devel"
makedepends="python-devel libglib-devel libressl-devel libusb-devel libplist-devel libusbmuxd-devel"