musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/include/utmp.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/utmp.h
parentb17c75a4d539d7ec5b81cc7ce7ce6b065a87e7a6 (diff)
downloadmusl-3cd6f5229f079f892411e82fce3fe15c78eef4d8.tar.gz
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/utmp.h')
0 files changed, 0 insertions, 0 deletions
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月07日 16:08:40 +0000

AltStyle によって変換されたページ (->オリジナル) /