[gdm] Don't pass random value to XdmcpFill
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Don't pass random value to XdmcpFill
- Date: Fri, 27 Aug 2010 15:29:05 +0000 (UTC)
commit 832d49174f86782b7e2b994e86357582c9d69ed6
Author: Ray Strode <rstrode redhat com>
Date: Fri Aug 27 11:19:51 2010 -0400
Don't pass random value to XdmcpFill
commit e533f4b72568cdc3d7f7ec6cec09d9392b11d54c
(combined with commit f7a7158efcaa3e113a02dd0f0bfdf22a253928e5
and commit 86ac166294f0fc8f662031167066acf1928cf139)
changed the length passed to XdmcpFill to use gdm_sockaddr_len,
macro. This macro is being called on an uninitialized structure,
so it returns the wrong value.
I think commit e533f4b72568cdc3d7f7ec6cec09d9392b11d54c was a bit
too liberal in its gdm_sockaddr_len changes. While I can believe
some Solaris and FreeBSD networking calls require the exact socket
address structure length to be passed in, I doubt the call used
by XdmcpFill (recvfrom) is one of them. It would be impossible for
recvfrom to work for connection of different address families
if that were true.
This commit just reverts gdm_sockaddr_len-ification of those the
two places where XdmcpFill is called.
daemon/gdm-xdmcp-display-factory.c | 2 +-
gui/simple-chooser/gdm-host-chooser-widget.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
index 06fafae..f62fdfb 100644
--- a/daemon/gdm-xdmcp-display-factory.c
+++ b/daemon/gdm-xdmcp-display-factory.c
@@ -2889,7 +2889,7 @@ decode_packet (GIOChannel *source,
return TRUE;
}
- ss_len = (int)gdm_sockaddr_len (&clnt_ss);
+ ss_len = (int) sizeof (clnt_ss);
res = XdmcpFill (factory->priv->socket_fd, &factory->priv->buf, (XdmcpNetaddr)&clnt_ss, &ss_len);
if G_UNLIKELY (! res) {
diff --git a/gui/simple-chooser/gdm-host-chooser-widget.c b/gui/simple-chooser/gdm-host-chooser-widget.c
index 352c1e2..3e8a2e2 100644
--- a/gui/simple-chooser/gdm-host-chooser-widget.c
+++ b/gui/simple-chooser/gdm-host-chooser-widget.c
@@ -208,7 +208,7 @@ decode_packet (GIOChannel *source,
return TRUE;
}
- ss_len = (int)gdm_sockaddr_len (&clnt_ss);
+ ss_len = (int) sizeof (clnt_ss);
res = XdmcpFill (widget->priv->socket_fd, &buf, (XdmcpNetaddr)&clnt_ss, &ss_len);
if G_UNLIKELY (! res) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]