Date: Wed, 15 May 1996 16:40:11 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: current@freebsd.org Subject: Bug in FreeBSD??? (fwd) Message-ID: <199605152340.QAA15641@phaeton.artisoft.com>
next in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605152340.QAA15641>