mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix out of bounds error in mwvc and gcc by creating a temporary vector during decryption
This commit is contained in:
parent
49860895ce
commit
7ac3d8a612
@ -617,10 +617,14 @@ struct crypto_helper
|
||||
auto iv = hash(result.key_encryptor.hash, salt_with_block_key);
|
||||
iv.resize(16);
|
||||
|
||||
auto decrypted_segment = aes(key, iv, std::vector<std::uint8_t>(
|
||||
encrypted_package.begin() + static_cast<std::ptrdiff_t>(i),
|
||||
encrypted_package.begin() + static_cast<std::ptrdiff_t>(i) + segment_length),
|
||||
auto segment_begin = encrypted_package.begin() + static_cast<std::ptrdiff_t>(i);
|
||||
auto current_segment_length = static_cast<std::ptrdiff_t>(
|
||||
std::min(segment_length, encrypted_package.size() - i));
|
||||
auto segment_end = encrypted_package.begin() + i + current_segment_length;
|
||||
encrypted_segment.assign(segment_begin, segment_end);
|
||||
auto decrypted_segment = aes(key, iv, encrypted_segment,
|
||||
cipher_chaining::cbc, cipher_direction::decryption);
|
||||
decrypted_segment.resize(current_segment_length);
|
||||
|
||||
decrypted_package.insert(decrypted_package.end(),
|
||||
decrypted_segment.begin(), decrypted_segment.end());
|
||||
|
2
third-party/botan
vendored
2
third-party/botan
vendored
@ -1 +1 @@
|
||||
Subproject commit 923a95d546df5b6d31f39b0af900d0361fb2e6a6
|
||||
Subproject commit 5372d0b499ad317ab3776c9ac92df866cc6a1e84
|
2
third-party/libstudxml
vendored
2
third-party/libstudxml
vendored
@ -1 +1 @@
|
||||
Subproject commit 132522ca4c895e9b07d7e323d5529474806e5829
|
||||
Subproject commit f94dd7ccee2014ab6240efbf5074b2f39dc32225
|
2
third-party/pugixml
vendored
2
third-party/pugixml
vendored
@ -1 +1 @@
|
||||
Subproject commit a832e8a5eff11f58a00ca41ec51ff3895b0da165
|
||||
Subproject commit 91bf70231aae8eddaccd5a6f5b0833712c471cb3
|
2
third-party/utfcpp
vendored
2
third-party/utfcpp
vendored
@ -1 +1 @@
|
||||
Subproject commit a5ad5ec9d936d63e9c010d1054f8b11fed0fabbc
|
||||
Subproject commit 0232ab8188b16ae6f2293a5817f1d9b0030879a3
|
Loading…
x
Reference in New Issue
Block a user