Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-08-26 22:07:10 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-08-26 22:07:10 +0300
commit219a1deb2a2c24dfe030db9de4211516d01ecce6 (patch)
tree7fc527453087e008fcbc16113d894cb96b4661a1 /example
parent3ce0b8439d2cf850d06bc9b046ffb56648875349 (diff)
Fix stack corruption bug in the convenience read() and write() initialiser list based overloads.
Diffstat (limited to 'example')
-rw-r--r--example/use_cases.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/example/use_cases.cpp b/example/use_cases.cpp
index 740312d6..6fc448b6 100644
--- a/example/use_cases.cpp
+++ b/example/use_cases.cpp
@@ -52,7 +52,7 @@ void read_entire_file1()
std::vector<llfio::byte> buffer(fh.maximum_extent().value());
// Synchronous scatter read from file
- llfio::file_handle::buffers_type filled = llfio::read(
+ llfio::file_handle::size_type bytesread = llfio::read(
fh, // handle to read from
0, // offset
{{ buffer.data(), buffer.size() }} // Single scatter buffer of the vector
@@ -61,7 +61,7 @@ void read_entire_file1()
// In case of racy truncation of file by third party to new length, adjust buffer to
// bytes actually read
- buffer.resize(filled[0].size());
+ buffer.resize(bytesread);
//! [file_entire_file1]
}