From owner-freebsd-current Wed May 15 16:42:30 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA03940 for current-outgoing; Wed, 15 May 1996 16:42:30 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA03934 for ; Wed, 15 May 1996 16:42:28 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id QAA15641 for current@freebsd.org; Wed, 15 May 1996 16:40:11 -0700 From: Terry Lambert Message-Id: <199605152340.QAA15641@phaeton.artisoft.com> Subject: Bug in FreeBSD??? (fwd) To: current@freebsd.org Date: Wed, 15 May 1996 16:40:11 -0700 (MST) X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > cmp file1 file2 1119 1119 > > Every time I try to run the above command mmap() returns with errno set > to EINVAL. In the above example, the files are some 460K in length so > skipping the first 1K or so should not be a problem. I've looked over > the source for cmp and don't think there's a problem with how it > calculates size and offsets. I believe the bug is in mmap, which should, according to the man page's implication, map the region from the start of the file to offset 1119 and return offset 1119. So if you stomped or referenced the returned offset -2, you would stomp/read a valid address at 1117 in the file. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.