diff options
author | Jukka Rissanen <jukka.rissanen@nokia.com> | 2010-06-29 06:29:29 (GMT) |
---|---|---|
committer | Adrian Constantin <adrian.constantin@nokia.com> | 2010-07-16 14:39:54 (GMT) |
commit | ab4dde176cfa314522964e5e5fbf9f2d388f8fdf (patch) | |
tree | 9de17a9a82f202c0d9da017bdf350237686f7a0f | |
parent | f231bd03007484d239cb5456db9e20a1f9ab7a63 (diff) | |
download | Qt-ab4dde176cfa314522964e5e5fbf9f2d388f8fdf.zip Qt-ab4dde176cfa314522964e5e5fbf9f2d388f8fdf.tar.gz Qt-ab4dde176cfa314522964e5e5fbf9f2d388f8fdf.tar.bz2 |
Do not crash if addrinfo signal does not contain ip address information.
Fixes: NB#176643 - Segmentation fault occurs while using networking
Reviewed-by: Adrian Constantin
-rw-r--r-- | src/plugins/bearer/icd/qnetworksession_impl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp index e375b4f..aeac620 100644 --- a/src/plugins/bearer/icd/qnetworksession_impl.cpp +++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp @@ -620,6 +620,9 @@ static QString get_network_interface() return iface; } + if (addr_results.first().ip_info.isEmpty()) + return QString(); + const char *address = addr_results.first().ip_info.first().address.toAscii().constData(); struct in_addr addr; if (inet_aton(address, &addr) == 0) { |