From owner-svn-src-head@FreeBSD.ORG Tue Oct 29 20:38:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 458F6CAA; Tue, 29 Oct 2013 20:38:01 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 180F324D2; Tue, 29 Oct 2013 20:38:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9TKc0um024997; Tue, 29 Oct 2013 20:38:00 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9TKc0IM024996; Tue, 29 Oct 2013 20:38:00 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201310292038.r9TKc0IM024996@svn.freebsd.org> From: Sean Bruno Date: Tue, 29 Oct 2013 20:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257363 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Oct 2013 20:38:01 -0000 Author: sbruno Date: Tue Oct 29 20:38:00 2013 New Revision: 257363 URL: http://svnweb.freebsd.org/changeset/base/257363 Log: Queisce sign errors by using unsigned char * and casting MAP_FAILED as unsigned char * Reviewed by: brooks@ Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Tue Oct 29 20:36:04 2013 (r257362) +++ head/usr.bin/xinstall/xinstall.c Tue Oct 29 20:38:00 2013 (r257363) @@ -1002,7 +1002,7 @@ compare(int from_fd, const char *from_na int to_fd, const char *to_name __unused, size_t to_len, char **dresp) { - char *p, *q; + unsigned char *p, *q; int rv; int done_compare; DIGEST_CTX ctx; @@ -1018,11 +1018,11 @@ compare(int from_fd, const char *from_na if (trymmap(from_fd) && trymmap(to_fd)) { p = mmap(NULL, from_len, PROT_READ, MAP_SHARED, from_fd, (off_t)0); - if (p == (char *)MAP_FAILED) + if (p == (unsigned char *)MAP_FAILED) goto out; q = mmap(NULL, from_len, PROT_READ, MAP_SHARED, to_fd, (off_t)0); - if (q == (char *)MAP_FAILED) { + if (q == (unsigned char *)MAP_FAILED) { munmap(p, from_len); goto out; } @@ -1036,7 +1036,7 @@ compare(int from_fd, const char *from_na } out: if (!done_compare) { - char buf1[MAXBSIZE]; + unsigned char buf1[MAXBSIZE]; char buf2[MAXBSIZE]; int n1, n2; @@ -1146,7 +1146,8 @@ copy(int from_fd, const char *from_name, { int nr, nw; int serrno; - char *p, buf[MAXBSIZE]; + unsigned char *p; + unsigned char buf[MAXBSIZE]; int done_copy; DIGEST_CTX ctx; @@ -1166,7 +1167,7 @@ copy(int from_fd, const char *from_name, done_copy = 0; if (size <= 8 * 1048576 && trymmap(from_fd) && (p = mmap(NULL, (size_t)size, PROT_READ, MAP_SHARED, - from_fd, (off_t)0)) != (char *)MAP_FAILED) { + from_fd, (off_t)0)) != (unsigned char *)MAP_FAILED) { nw = write(to_fd, p, size); if (nw != size) { serrno = errno;