projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
640986b
)
Marshall Clow found this memory problem in strstream using -fsanitize=address on...
author
Howard Hinnant
<hhinnant@apple.com>
Tue, 19 Mar 2013 22:16:57 +0000
(22:16 +0000)
committer
Howard Hinnant
<hhinnant@apple.com>
Tue, 19 Mar 2013 22:16:57 +0000
(22:16 +0000)
llvm-svn: 177452
libcxx/src/strstream.cpp
patch
|
blob
|
history
diff --git
a/libcxx/src/strstream.cpp
b/libcxx/src/strstream.cpp
index
8cd19e6
..
518422b
100644
(file)
--- a/
libcxx/src/strstream.cpp
+++ b/
libcxx/src/strstream.cpp
@@
-158,6
+158,8
@@
strstreambuf::overflow(int_type __c)
return int_type(EOF);
streamsize old_size = (epptr() ? epptr() : egptr()) - eback();
streamsize new_size = max<streamsize>(__alsize_, 2*old_size);
+ if (new_size == 0)
+ new_size = __default_alsize;
char* buf = nullptr;
if (__palloc_)
buf = static_cast<char*>(__palloc_(static_cast<size_t>(new_size)));