diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-08-26 22:07:10 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-08-26 22:07:10 +0300 |
commit | 219a1deb2a2c24dfe030db9de4211516d01ecce6 (patch) | |
tree | 7fc527453087e008fcbc16113d894cb96b4661a1 /test/tests/map_handle_create_close | |
parent | 3ce0b8439d2cf850d06bc9b046ffb56648875349 (diff) |
Fix stack corruption bug in the convenience read() and write() initialiser list based overloads.
Diffstat (limited to 'test/tests/map_handle_create_close')
-rw-r--r-- | test/tests/map_handle_create_close/runner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/tests/map_handle_create_close/runner.cpp b/test/tests/map_handle_create_close/runner.cpp index 2198e7b8..41e2ec71 100644 --- a/test/tests/map_handle_create_close/runner.cpp +++ b/test/tests/map_handle_create_close/runner.cpp @@ -115,13 +115,15 @@ template <class U> inline void map_handle_create_close_(U &&f) // Make sure maph's read() does what it is supposed to if (use_file_backing) { - auto b = maph.read(0, { {nullptr, 20} }).value(); + map_handle::buffer_type req{ nullptr, 20 }; + auto b = maph.read({ req, 0 }).value(); KERNELTEST_CHECK(testreturn, b[0].data() == addr); KERNELTEST_CHECK(testreturn, b[0].size() == 19); // reads do not read more than the backing length } else { - auto b = maph.read(5, { {nullptr, 5000} }).value(); + map_handle::buffer_type req{ nullptr, 5000 }; + auto b = maph.read({ req, 5 }).value(); KERNELTEST_CHECK(testreturn, b[0].data() == addr+5); // NOLINT KERNELTEST_CHECK(testreturn, b[0].size() == 4091); } |