Don't try to mmap past EOF
commit79da7bb4739f9f63178ce5146702dce6b8feafb9
authorJoão Abecasis <joao@abecasis.name>
Wed, 28 Oct 2009 13:09:04 +0000 (28 14:09 +0100)
committerJoão Abecasis <joao@abecasis.name>
Wed, 28 Oct 2009 13:45:18 +0000 (28 14:45 +0100)
tree5a885231046f4752e236c2d9663a4fc26cc193ea
parent22b223c31ff961f52f62eaf20aa571b71dfe3bb8
Don't try to mmap past EOF

On Mac OS, mmap would succeed, returning a valid pointer, but trying to
read from it would result in a SIGBUS.

By adding this check we commit to a safe cross-platform behavior users
can depend on.

Reviewed-by: Thiago Macieira
src/corelib/io/qfsfileengine_unix.cpp