packages/net/iotivity/patches/070-Avoid-Segv-by-testing-address-field-before-using-it.patch
Hauke Mehrtens 0ec3a55767 iotivity: update to version 0.9.2
This brings IoTivity to version 0.9.2 in addition it does the following:
* split C and C++ Stack into two packages
* backport some patches which are adding missing dependencies to the shared libs
* remove patches merged upstream
* add some other patches fixing some problems, most of them are already merged upstream
* activate security and logging support

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
2015-08-29 22:15:25 +02:00

29 lines
1.1 KiB
Diff

From a8f5ed3ff337bce5222967fdf8c0b475fd28e74a Mon Sep 17 00:00:00 2001
From: John Light <john.j.light@intel.com>
Date: Thu, 30 Jul 2015 15:14:07 -0700
Subject: [PATCH] Avoid Segv by testing address field before using it.
sIssue reported off dev list by Gabriel Schulhof.
Change-Id: Ifa529da59fb784fd5cdef6ca333635cf99ed1f59
Signed-off-by: John Light <john.j.light@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2160
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
---
.../src/ip_adapter/linux/caipnwmonitor.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/resource/csdk/connectivity/src/ip_adapter/linux/caipnwmonitor.c
+++ b/resource/csdk/connectivity/src/ip_adapter/linux/caipnwmonitor.c
@@ -57,6 +57,10 @@ u_arraylist_t *CAIPGetInterfaceInformati
struct ifaddrs *ifa = NULL;
for (ifa = ifp; ifa; ifa = ifa->ifa_next)
{
+ if (!ifa->ifa_addr)
+ {
+ continue;
+ }
int family = ifa->ifa_addr->sa_family;
if ((ifa->ifa_flags & IFF_LOOPBACK) || (AF_INET != family && AF_INET6 != family))
{