[Commits] [SCM] claws branch, master, updated. 4.2.0-81-g507ce6782

mones at claws-mail.org mones at claws-mail.org
Fri Apr 12 14:39:37 UTC 2024


The branch, master has been updated
       via  507ce6782cdb711b4c41d36c884b8d2ca48cb29a (commit)
      from  8866fc11593241e97786a61ce129fe0c10403ee7 (commit)

Summary of changes:
 src/common/socket.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 507ce6782cdb711b4c41d36c884b8d2ca48cb29a
Author: Olaf Hering <olaf at aepfle.de>
Date:   Fri Apr 12 16:38:43 2024 +0200

    Fix bug 4786 "remove type confusion in getsockopt call in sock_connect_async_cb"
    
    The function getsockopt expects a pointer to an area of memory whose
    length has to specified in a variable of type socklen_t.
    
    Adjust the type of optlen to be socklen_t as mandated by POSIX.
    
    Adjust the type of optval pointer to what it really is, it will be
    automatically converted to become a void * pointer.
    
    Signed-off-by: Olaf Hering <olaf at aepfle.de>

diff --git a/src/common/socket.c b/src/common/socket.c
index e9d50184b..a63c9a7a8 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -709,7 +709,7 @@ static gboolean sock_connect_async_cb(GIOChannel *source,
 	SockConnectData *conn_data = (SockConnectData *)data;
 	gint fd;
 	gint val;
-	guint len;
+	socklen_t len;
 	SockInfo *sockinfo;
 
 	if (conn_data->io_tag == 0 && conn_data->channel == NULL)
@@ -722,7 +722,7 @@ static gboolean sock_connect_async_cb(GIOChannel *source,
 	g_io_channel_unref(source);
 
 	len = sizeof(val);
-	if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)&val, &len) < 0) {
+	if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &val, &len) < 0) {
 		perror("getsockopt");
 		close(fd);
 		sock_connect_address_list_async(conn_data);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list