about summary refs log tree commit diff
path: root/include/sysexits.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-06-27 12:48:59 -0400
committerRich Felker <dalias@aerifal.cx>2013-06-27 12:48:59 -0400
commit3cd6f5229f079f892411e82fce3fe15c78eef4d8 (patch)
treefd513b5adab33019ed5251ffea1076eec6140afc /include/sysexits.h
parentb17c75a4d539d7ec5b81cc7ce7ce6b065a87e7a6 (diff)
downloadmusl-3cd6f5229f079f892411e82fce3fe15c78eef4d8.tar.gz
musl-3cd6f5229f079f892411e82fce3fe15c78eef4d8.tar.xz
musl-3cd6f5229f079f892411e82fce3fe15c78eef4d8.zip
disallow creation of objects larger than PTRDIFF_MAX via mmap
internally, other parts of the library assume sizes don't overflow
ssize_t and/or ptrdiff_t, and the way this assumption is made valid is
by preventing creating of such large objects. malloc already does so,
but the check was missing from mmap.

this is also a quality of implementation issue: even if the
implementation internally could handle such objects, applications
could inadvertently invoke undefined behavior by subtracting pointers
within an object. it is very difficult to guard against this in
applications, so a good implementation should simply ensure that it
does not happen.
Diffstat (limited to 'include/sysexits.h')
0 files changed, 0 insertions, 0 deletions