| 218 | } |
| 219 | |
| 220 | string CodedInputDataCrypt::readString(KeyValueHolderCrypt &kvHolder) { |
| 221 | kvHolder.offset = static_cast<uint32_t>(m_position); |
| 222 | |
| 223 | int32_t size = this->readRawVarint32(true); |
| 224 | if (size < 0) { |
| 225 | throw length_error("InvalidProtocolBuffer negativeSize"); |
| 226 | } |
| 227 | |
| 228 | auto s_size = static_cast<size_t>(size); |
| 229 | if (s_size <= m_size - m_position) { |
| 230 | consumeBytes(s_size); |
| 231 | |
| 232 | kvHolder.keySize = static_cast<uint16_t>(s_size); |
| 233 | |
| 234 | string result((char *) (m_decryptBuffer + m_decryptBufferPosition), s_size); |
| 235 | m_position += s_size; |
| 236 | m_decryptBufferPosition += s_size; |
| 237 | return result; |
| 238 | } else { |
| 239 | throw out_of_range("InvalidProtocolBuffer truncatedMessage"); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | void CodedInputDataCrypt::readData(KeyValueHolderCrypt &kvHolder) { |
| 244 | int32_t size = this->readRawVarint32(); |
nothing calls this directly
no test coverage detected