]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Clamp tuklib_physmem() return value to SIZE_T_MAX.
authorKonstantin Belousov <kib@FreeBSD.org>
Sun, 6 Jan 2019 23:59:04 +0000 (23:59 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Sun, 6 Jan 2019 23:59:04 +0000 (23:59 +0000)
commit866fe991ac4014aafb031f2651f52444e2fdf3c5
tree4ec056647af07655cde3836a3cff930a19f09a7e
parent9f0bfc517ca9f5b929eb7125d0da53f6705e6e2f
Clamp tuklib_physmem() return value to SIZE_T_MAX.

On 32bit platforms it is possible to have (much) more physical RAM
than is mappable into single address space.  In this case liblzma
scales the value into a request to mmap more address space than it is
theoretically possible.

Reported and tested by: pho
Reviewed by: delphij
Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
contrib/xz/src/common/tuklib_physmem.c