summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2007-06-18 04:31:54 +0000
committerBrian Cameron <bcameron@src.gnome.org>2007-06-18 04:31:54 +0000
commitab9b2500fdcb3a51e8d8c1fc9810aefa85217ae2 (patch)
treee8a37987c6a12cf5e42091402271fb41ceec566a
parent1ae24331e7c20e4d9acc1a1059d9dac1141efbb0 (diff)
downloadgdm-ab9b2500fdcb3a51e8d8c1fc9810aefa85217ae2.tar.gz
Fix crashing issue with XDMCP logic. Fixes problem with accessing NULL
2007-06-17 Brian Cameron <brian.cameron@sun.com> * daemon/xdmcp.c, daemon/misc.c: Fix crashing issue with XDMCP logic. Fixes problem with accessing NULL pointers when using IPv4 with IPv6 enabled. Fixes bug #436725. svn path=/branches/gnome-2-18/; revision=4996
-rw-r--r--ChangeLog6
-rw-r--r--daemon/misc.c5
-rw-r--r--daemon/xdmcp.c5
3 files changed, 14 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 19b220cf..ab2908cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-17 Brian Cameron <brian.cameron@sun.com>
+
+ * daemon/xdmcp.c, daemon/misc.c: Fix crashing issue with
+ XDMCP logic. Fixes problem with accessing NULL pointers
+ when using IPv4 with IPv6 enabled. Fixes bug #436725.
+
2007-05-28 William Jon McCann <mccann@jhu.edu>
* Release 2.18.2:
diff --git a/daemon/misc.c b/daemon/misc.c
index b4b3fd91..7be86f2a 100644
--- a/daemon/misc.c
+++ b/daemon/misc.c
@@ -1204,6 +1204,8 @@ gdm_peek_local_address_list (void)
gboolean
gdm_is_local_addr6 (struct in6_addr* ia)
{
+ if (ia == NULL)
+ return FALSE;
if (IN6_IS_ADDR_LOOPBACK (ia)) {
return TRUE;
@@ -1231,6 +1233,9 @@ gdm_is_local_addr (struct in_addr *ia)
{
const char lo[] = {127,0,0,1};
+ if (ia == NULL)
+ return FALSE;
+
if (ia->s_addr == INADDR_LOOPBACK ||
memcmp (&ia->s_addr, lo, 4) == 0) {
return TRUE;
diff --git a/daemon/xdmcp.c b/daemon/xdmcp.c
index 2e25cbe2..5a615873 100644
--- a/daemon/xdmcp.c
+++ b/daemon/xdmcp.c
@@ -810,7 +810,8 @@ gdm_xdmcp_handle_query (struct sockaddr_in *clnt_sa, gint len, gint type)
struct in_addr *addr;
#ifdef ENABLE_IPV6
- if (saddr->sa_family == AF_INET6) {
+ if (saddr->sa_family == AF_INET6 && id != NULL &&
+ id->chosen_host6 != NULL) {
addr6 = &(((struct sockaddr_in6 *)saddr)->sin6_addr);
if ( ! gdm_is_loopback_addr6 (addr6)) {
/* forward query to * chosen host */
@@ -837,7 +838,7 @@ gdm_xdmcp_handle_query (struct sockaddr_in *clnt_sa, gint len, gint type)
} else {
/* or send forward query to chosen host */
#ifdef ENABLE_IPV6
- if (clnt_sa->ss_family == AF_INET6)
+ if (clnt_sa->ss_family == AF_INET6 && id != NULL && id->chosen_host6 != NULL)
{
gdm_xdmcp_send_forward_query6
(id, (struct sockaddr_in6 *)clnt_sa,