Nelson H. F. Beebe
2006-Oct-16 15:00 UTC
rsync-2.6.9pre2: undeclared variable in source code
A build of rsync-2.6.9pre2 on DEC Alpha OSF/1 4.0 failed because of an undeclared variable at lib/inet_ntop.c:84: memcpy(dst, tmp, len + 1); len is not declared; the code looks like the third argument should instead be the value strlen(tmp) + 1 I made that change, restarted the build and validation, and got this report: ----- daemon-gzip-download rsyncd.log ends FAIL daemon-gzip-download ----- daemon-gzip-upload rsyncd.log ends FAIL daemon-gzip-upload PASS daemon ... ------------------------------------------------------------ ----- overall results: 25 passed 2 failed 4 skipped ------------------------------------------------------------ overall result is 2 ------------------------------------------------------------------------------- - Nelson H. F. Beebe Tel: +1 801 581 5254 - - University of Utah FAX: +1 801 581 4148 - - Department of Mathematics, 110 LCB Internet e-mail: beebe@math.utah.edu - - 155 S 1400 E RM 233 beebe@acm.org beebe@computer.org - - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ - -------------------------------------------------------------------------------
On Mon, Oct 16, 2006 at 08:11:40AM -0600, Nelson H. F. Beebe wrote:> A build of rsync-2.6.9pre2 on DEC Alpha OSF/1 4.0 failed because of > an undeclared variable at lib/inet_ntop.c:84: > > memcpy(dst, tmp, len + 1);I apparently left out the code that set "len". The attached patch fixes this.> ----- daemon-gzip-download rsyncd.log ends > FAIL daemon-gzip-download > ----- daemon-gzip-upload rsyncd.log ends > FAIL daemon-gzip-uploadIf you'd email me (not the list) the output from the testtmp.*/*log files, I'll take a look at what they indicate. ..wayne.. -------------- next part -------------- --- lib/inet_ntop.c 13 Oct 2006 23:17:37 -0000 1.4 +++ lib/inet_ntop.c 16 Oct 2006 17:53:43 -0000 @@ -75,9 +75,10 @@ inet_ntop4(const unsigned char *src, cha { static const char *fmt = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; + size_t len; - if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) - { + len = snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]); + if (len >= size) { errno = ENOSPC; return (NULL); }
Apparently Analagous Threads
- rsync-2.5.5rc1: two problems on Apple Darwin (== MacOS X)
- rsync-2.5.5rc1: README file out-of-date
- ssh-openbsd-2003091700 distribution missing gss_krb5_copy_ccache
- Patches for rsync.mbox
- Re: R 1.7.x and inaccurate log1p() on OpenBSD 3.2 and NetBSD 1.6 (PR#3979)