diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-05-14 16:19:07 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2009-05-14 16:19:07 +0200 |
commit | 7ffdc91f513d6b91d060df6e3ad3401ef23e968d (patch) | |
tree | c60d1cadf6daf2611dfb7c0c867ef1e5e8c04f8b | |
parent | 145cec3c93d5ba0c22d35aaf341b3713cadc0e14 (diff) | |
download | glib-7ffdc91f513d6b91d060df6e3ad3401ef23e968d.tar.gz |
Set optlen before calling getsockopt
We were sometimes failing in g_socket_check_pending_error because
we were not setting optlen on input and it was sometimes randomly
less than sizeof(int).
-rw-r--r-- | gio/gsocket.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gio/gsocket.c b/gio/gsocket.c index ba78e240b..059f14ed0 100644 --- a/gio/gsocket.c +++ b/gio/gsocket.c @@ -1501,6 +1501,7 @@ g_socket_check_pending_error (GSocket *socket, guint optlen; int value; + optlen = sizeof (value); if (getsockopt (socket->priv->fd, SOL_SOCKET, SO_ERROR, (void *)&value, &optlen) != 0) { int errsv = get_socket_errno (); |