[Toybox] [PATCH] Add and use xmmap.

enh enh at google.com
Tue May 23 17:38:40 PDT 2017


Everyone forgets that mmap returns MAP_FAILED rather than NULL on failure.
Every use of mmap in toybox was either doing the wrong check, or no check
at all (including the two I personally added).
---
 lib/lib.h                  |   1 +
 lib/xwrap.c                |   7 ++
 toys/android/load_policy.c |   6 +-
 toys/other/hexedit.c       |   2 +-
 toys/other/modinfo.c       |   4 +-
 toys/pending/mdev.c        | 175 ++++++++++++++++++++++-----------------------
 toys/posix/file.c          |   3 +-
 7 files changed, 102 insertions(+), 96 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-and-use-xmmap.patch
Type: text/x-patch
Size: 9954 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170523/9e7b82aa/attachment-0002.bin>


More information about the Toybox mailing list