diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-06-27 12:48:59 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-06-27 12:48:59 -0400 |
commit | 3cd6f5229f079f892411e82fce3fe15c78eef4d8 (patch) | |
tree | fd513b5adab33019ed5251ffea1076eec6140afc /src/stat/__fxstat.c | |
parent | b17c75a4d539d7ec5b81cc7ce7ce6b065a87e7a6 (diff) | |
download | musl-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 'src/stat/__fxstat.c')
0 files changed, 0 insertions, 0 deletions