Repository navigation
UCS/CONFIG: fixed crash on incorrect value set - #5987
Merged
yosefe merged 1 commit intoDec 9, 2020
Merged
Conversation
Contributor
Author
|
added test |
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
bot:pipe:retest |
yosefe
reviewed
Dec 8, 2020
Comment on lines
+486
to
+487
| scoped_log_handler log_handler_vars(config_error_suppress); | ||
| opts.set("COLOR", "magenta"); |
| } | ||
|
|
||
| static ucs_log_func_rc_t | ||
| config_error_suppress(const char *file, unsigned line, const char *function, |
Contributor
Author
There was a problem hiding this comment.
technically yes, but in this case we can't check if error is handled - there is no errors counter in wrap_errors_logger
Member
There was a problem hiding this comment.
can we call wrap_errors_logger() after counting, to print err message?
yosefe
reviewed
Dec 8, 2020
Comment on lines
+489
to
+492
| EXPECT_EQ(COLOR_WHITE, opts->color); | ||
| EXPECT_EQ(std::string(color_names[COLOR_WHITE]), | ||
| std::string(opts.get("COLOR"))); | ||
| EXPECT_EQ(1, m_errors); |
Contributor
Author
There was a problem hiding this comment.
moved outside of scope
yosefe
reviewed
Dec 8, 2020
| m_errors++; | ||
| wrap_errors_logger(file, line, function, level, comp_conf, | ||
| message, ap); | ||
| return UCS_LOG_FUNC_RC_STOP; |
Member
There was a problem hiding this comment.
minor: return wrap_errors_logger(..)
| class test_config : public ucs::test { | ||
| public: | ||
| test_config() { | ||
| m_errors = 0; |
Contributor
Author
There was a problem hiding this comment.
renamed to m_num_errors
yosefe
approved these changes
Dec 8, 2020
Member
|
@hoopoepg pls squash |
- there was possible double free of string when user tried to set incorrect value using ucs_config_parser_set_value function - added gtest
hoopoepg
force-pushed
the
topic/fixed-crash-on-incorrect-conf-value
branch
from
December 9, 2020 10:47
529eaeb to
9d87dcb
Compare
Contributor
Author
|
squashed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
user tried to set incorrect value using ucs_config_parser_set_value
function
fixes #5980