Skip to content

Update stringstream test sink to bounds check the strings#2016

Merged
wezrule merged 1 commit intonanocurrency:masterfrom
wezrule:asan_stringstream_test
May 22, 2019
Merged

Update stringstream test sink to bounds check the strings#2016
wezrule merged 1 commit intonanocurrency:masterfrom
wezrule:asan_stringstream_test

Conversation

@wezrule
Copy link
Copy Markdown
Contributor

@wezrule wezrule commented May 22, 2019

@SergiySW found an ASAN warning when running the confirmation_height.conflict_rollback_cemented test. The const char * does not appear to be null terminated. Cannot use std::stringstream::read as it expects a non-const char array and would prefer not to introduce a const_cast. It's only used in tests so just going to construct a new string of the expected size.

@wezrule wezrule added unit test Related to a new, changed or fixed unit test sanitizers Related to thread, address or undefined sanitizers labels May 22, 2019
@wezrule wezrule added this to the V19.0 milestone May 22, 2019
@wezrule wezrule requested a review from SergiySW May 22, 2019 17:50
@wezrule wezrule self-assigned this May 22, 2019
Copy link
Copy Markdown
Contributor

@SergiySW SergiySW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wezrule wezrule merged commit 4bf4c95 into nanocurrency:master May 22, 2019
@wezrule wezrule deleted the asan_stringstream_test branch May 22, 2019 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitizers Related to thread, address or undefined sanitizers unit test Related to a new, changed or fixed unit test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants