Skip to content

Commit e00c6be

Browse files
committed
Changed the read buffers allocation from reserve() to resize(). Closes #54.
1 parent 65a917f commit e00c6be

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## Unreleased
99

10+
## [2.8.3] - 2025-04-01
11+
12+
- Changed the read buffers allocation from `reserve()` to `resize()`. This should fix potential crashes due to a misuse of the C++ std API.
13+
1014
## [2.8.2] - 2024-06-02
1115

1216
- Fix bug where this project could not be added into another CMake file with `add_subdirectory()` correctly (thanks [alexg-k](https://github.com/alexg-k)).
@@ -144,7 +148,8 @@ Big thanks to https://github.com/MadsAndreasen-Zoetis for these improvements.
144148
### Added
145149
- Initial commit. serial-port-cpp library has basic functions up and running.
146150
147-
[Unreleased]: https://github.com/mbedded-ninja/CppLinuxSerial/compare/v2.8.2...HEAD
151+
[Unreleased]: https://github.com/mbedded-ninja/CppLinuxSerial/compare/v2.8.3...HEAD
152+
[v2.8.3]: https://github.com/mbedded-ninja/CppLinuxSerial/compare/v2.8.2...v2.8.3
148153
[v2.8.2]: https://github.com/mbedded-ninja/CppLinuxSerial/compare/v2.8.1...v2.8.2
149154
[v2.8.1]: https://github.com/mbedded-ninja/CppLinuxSerial/compare/v2.8.0...v2.8.1
150155
[v2.8.0]: https://github.com/mbedded-ninja/CppLinuxSerial/compare/v2.7.2...v2.8.0

src/SerialPort.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace CppLinuxSerial {
4040
baudRateType_ = BaudRateType::STANDARD;
4141
baudRateStandard_ = defaultBaudRate_;
4242
readBufferSize_B_ = defaultReadBufferSize_B_;
43-
readBuffer_.reserve(readBufferSize_B_);
43+
readBuffer_.resize(readBufferSize_B_);
4444
state_ = State::CLOSED;
4545
}
4646

0 commit comments

Comments
 (0)