projects
/
folly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63b6181
)
fix segfault on fb platform
author
Tudor Bosman
<tudorb@fb.com>
Thu, 9 May 2013 22:17:13 +0000
(15:17 -0700)
committer
Sara Golemon
<sgolemon@fb.com>
Mon, 20 May 2013 18:01:27 +0000
(11:01 -0700)
Summary: Strings can be moved around while the vector grows.
Test Plan: file_util_test
Reviewed By: lucian@fb.com
FB internal diff:
D806966
Blame Revision:
D806781
folly/test/FileUtilTest.cpp
patch
|
blob
|
history
diff --git
a/folly/test/FileUtilTest.cpp
b/folly/test/FileUtilTest.cpp
index 8b50b5cfd2feb76f64767b1737c9ac2487e06ad9..f9fe52b7e3f6e8bf52e578faa25a29ddf2b66af3 100644
(file)
--- a/
folly/test/FileUtilTest.cpp
+++ b/
folly/test/FileUtilTest.cpp
@@
-192,9
+192,11
@@
IovecBuffers::IovecBuffers(std::initializer_list<size_t> sizes) {
iov_.reserve(sizes.size());
for (auto& s : sizes) {
buffers_.push_back(std::string(s, '\0'));
+ }
+ for (auto& b : buffers_) {
iovec iov;
- iov.iov_base = &
(buffers_.back()[0])
;
- iov.iov_len =
s
;
+ iov.iov_base = &
b[0]
;
+ iov.iov_len =
b.size()
;
iov_.push_back(iov);
}
}