Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  1 Mar 2002 21:31:54 +0100 (CET)
From:      Daniel Lang <langd@leo.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/35462: patch to rsync-2.5.2
Message-ID:  <20020301203154.9D80E22E54@atleo5.leo.org>

next in thread | raw e-mail | index | archive | help

>Number:         35462
>Category:       ports
>Synopsis:       patch to rsync-2.5.2
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 01 12:40:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Daniel Lang
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
LEO
>Environment:
System: FreeBSD atleo5.leo.org 4.5-STABLE FreeBSD 4.5-STABLE #3: Tue Feb 5 14:43:14 CET 2002 root@:/usr/obj/usr/src/sys/ATLEO5 i386

>Description:
  There is a serious bug in 2.5.2 that can cause data
  corruption or crash of rsync in server mode.
  It may not occur on every platform, but I guess it
  should be included anyway. The fix was done by the
  NetBSD team, and I just used their patch from pkgsrc.

>How-To-Repeat:
  -
>Fix:

--- match.c.orig	Fri Jan 25 23:07:34 2002
+++ match.c	Wed Feb 27 03:38:46 2002
@@ -246,8 +246,11 @@
 		   match. The 3 reads are caused by the
 		   running match, the checksum update and the
 		   literal send. */
-		if (offset-last_match >= CHUNK_SIZE+s->n && 
-		    (end-offset > CHUNK_SIZE)) {
+		/* NOTE: If we just matched a block, then offset<last_match
+		   (by 1).  The arithmetic here must be ordered so that type
+		   promotions (s->n is unsigned) do not cause a false match. */
+		if (offset >= last_match+CHUNK_SIZE+s->n && 
+		    end > offset+CHUNK_SIZE) {
 			matched(f,s,buf,offset - s->n, -2);
 		}
 	} while (++offset < end);
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020301203154.9D80E22E54>