Fix regression in ConnectAttempt - #5900
Conversation
Tapanito
left a comment
There was a problem hiding this comment.
Great catch! Thanks Bronek.
|
@Tapanito the semantics of optional and string seem to be really messed up here. |
|
@vvysokikh1 the previous code simply did a cast to bool, |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5900 +/- ##
=========================================
- Coverage 79.5% 79.5% -0.0%
=========================================
Files 816 816
Lines 72179 72179
Branches 8280 8276 -4
=========================================
- Hits 57367 57354 -13
- Misses 14812 14825 +13
🚀 New features to boost your workflow:
|
The regression that's being fixed here is that #5669 did change the semantics, from checking an equivalent of Here's the old code : |
yes, and you changed that to check if the string is not empty. My question here - was that an intentional change or a mistake. If that was intentional, this fix is not sufficient. If by mistake - i can approve then |
FWIW I find nothing in #5669 to indicate that was intentional. There's no change in |
A regression was introduced in #5669 which would cause rippled to potentially dereference a disengaged std::optional when connecting to a peer. This would cause UB in release build and crash in debug.
ed39003 to
e9c9862
Compare
A regression was introduced in XRPLF#5669 which would cause rippled to potentially dereference a disengaged std::optional when connecting to a peer. This would cause UB in release build and crash in debug. Co-authored-by: Bart Thomee <11445373+bthomee@users.noreply.github.com>
High Level Overview of Change
Fix a regression bug from #5669
Context of Change
A regression was introduced in #5669 which would cause
rippledto potentially dereference a disengagedstd::optionalwhen connecting to a peer. This would cause UB in release build and crash in debug.The bug does not affect version 3.0.0 since #5669 was not planned for release in this version and got explicitly reverted.
Type of Change