mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-10 03:54:54 -06:00
Core: StringStream ExcLimit exception fixed for big chunks of data
git-svn-id: svn://ultimatepp.org/upp/trunk@11833 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ead7b2d896
commit
e841fdffba
1 changed files with 2 additions and 2 deletions
|
|
@ -884,10 +884,10 @@ void StringStream::_Put(const void *d, dword sz)
|
|||
SetWriteMode();
|
||||
if(ptr + sz >= wrlim) {
|
||||
size_t p = ptr - buffer;
|
||||
if(limit != INT_MAX && p + sz > (size_t)limit)
|
||||
throw LimitExc();
|
||||
if(p + sz >= INT_MAX)
|
||||
Panic("2GB StringStream limit exceeded");
|
||||
if(p + sz > (size_t)limit)
|
||||
throw LimitExc();
|
||||
int len = (int32)max((int64)128, min((int64)limit, max(2 * GetSize(), GetSize() + sz)));
|
||||
wdata.SetLength(len);
|
||||
SetWriteBuffer();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue