From e93a964cc33bca1438553a62c05a13a980b4a2eb Mon Sep 17 00:00:00 2001 From: Nigel Metheringham Date: Thu, 12 Nov 2009 08:34:23 +0000 Subject: [PATCH] Correct connect() call in dcc code. Fixes: #909 --- doc/doc-txt/ChangeLog | 4 +++- src/src/dcc.c | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 01ec5d2a9..67529ad2f 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -1,4 +1,4 @@ -$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.589 2009/11/09 10:22:10 nm4 Exp $ +$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.590 2009/11/12 08:34:23 nm4 Exp $ Change log file for Exim from version 4.21 ------------------------------------------- @@ -151,6 +151,8 @@ NM/34 Bugzilla 901: Fix sign/unsigned and UTF mistmatches NM/35 Bugzilla 39: Base64 decode bug fixes Patch by Jakob Hirsch +NM/36 Bugzilla 909: Correct connect() call in dcc code + Exim version 4.69 ----------------- diff --git a/src/src/dcc.c b/src/src/dcc.c index cc06ed9ce..ff760bcf6 100644 --- a/src/src/dcc.c +++ b/src/src/dcc.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/dcc.c,v 1.4 2009/11/11 10:08:01 nm4 Exp $ */ +/* $Cambridge: exim/src/src/dcc.c,v 1.5 2009/11/12 08:34:23 nm4 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -59,7 +59,7 @@ int dcc_process(uschar **listptr) { uschar *xtra_hdrs = NULL; /* from local_scan */ - int i, j, k, c, retval, sockfd, servlen, resp, line; + int i, j, k, c, retval, sockfd, resp, line; unsigned int portnr; struct sockaddr_un serv_addr; struct sockaddr_in serv_addr_in; @@ -219,7 +219,6 @@ int dcc_process(uschar **listptr) { bzero((char *)&serv_addr,sizeof(serv_addr)); serv_addr.sun_family = AF_UNIX; Ustrcpy(serv_addr.sun_path, sockpath); - servlen = Ustrlen(serv_addr.sun_path) + sizeof(serv_addr.sun_family); if ((sockfd = socket(AF_UNIX, SOCK_STREAM,0)) < 0){ DEBUG(D_acl) debug_printf("Creating socket failed: %s\n", strerror(errno)); @@ -229,7 +228,7 @@ int dcc_process(uschar **listptr) { return retval; } /* Now connecting the socket (UNIX) */ - if (connect(sockfd, (struct sockaddr *) &serv_addr, servlen) < 0){ + if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0){ DEBUG(D_acl) debug_printf("Connecting socket failed: %s\n", strerror(errno)); log_write(0,LOG_REJECT,"Connecting socket failed: %s\n", strerror(errno)); -- 2.25.1