added address validations to mmap memory reading/writing. Useful when reading untrusted data.