comparison OrthancFramework/Sources/ChunkedBuffer.cpp @ 4151:8c559dd5034b

Fix possible crash in HttpClient if sending multipart body (can occur in STOW-RS)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Aug 2020 11:59:02 +0200
parents b56f3a37a4a1
children 0034f855c023
comparison
equal deleted inserted replaced
4150:b56f3a37a4a1 4151:8c559dd5034b
99 assert(sizeof(char) == 1); 99 assert(sizeof(char) == 1);
100 100
101 // Optimization if Orthanc >= 1.7.3, to speed up in the presence of many small chunks 101 // Optimization if Orthanc >= 1.7.3, to speed up in the presence of many small chunks
102 if (pendingPos_ + chunkSize <= pendingBuffer_.size()) 102 if (pendingPos_ + chunkSize <= pendingBuffer_.size())
103 { 103 {
104 // There remain enough place in the pending buffer 104 // There remains enough place in the pending buffer
105 memcpy(&pendingBuffer_[pendingPos_], chunkData, chunkSize); 105 memcpy(&pendingBuffer_[pendingPos_], chunkData, chunkSize);
106 pendingPos_ += chunkSize; 106 pendingPos_ += chunkSize;
107 } 107 }
108 else 108 else
109 { 109 {