summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-08-20 14:33:30 +0000
committerjhb <jhb@FreeBSD.org>2015-08-20 14:33:30 +0000
commitedef59ae5270c40a1bc788aecacfae56ae788cd2 (patch)
tree5577fe5b1d9e5a6495688b8baaf8afe3a31d66fc /tests
parentca3ff2693cd42d868756745a08d82eea4a66c79f (diff)
downloadFreeBSD-src-edef59ae5270c40a1bc788aecacfae56ae788cd2.zip
FreeBSD-src-edef59ae5270c40a1bc788aecacfae56ae788cd2.tar.gz
Rework the argv and env string fetching for execve to be more robust.
Before truss would fetch 100 string pointers and happily walk off the end of the array if it never found a NULL. This also means for a short argv list it could fail entirely if the 100 string pointers spanned into an unmapped page. Instead, fetch page-aligned blocks of string pointers in a loop fetching each string until a NULL is found. While here, make use of the open memstream file descriptor instead of allocating a temporary array. This allows us to fetch each string once instead of twice.
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud