Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug: wrong size setting for StringStorage. Added UT. #1841

Merged

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Mar 4, 2021

BUG: When setting a string with shorter size than the one that exists, characters past the alleged size may remain from previous one.

Also added UT for StringStorage type.

@ethouris ethouris requested a review from maxsharabayko March 4, 2021 08:10
@ethouris ethouris added [core] Area: Changes in SRT library core [tests] Area: Unit tests Priority: Critical Type: Bug Indicates an unexpected problem or unintended behavior labels Mar 4, 2021
@ethouris ethouris added this to the v1.4.3 milestone Mar 4, 2021
Comment on lines +225 to +229
char example_ac1[] = "example_long";
char example_ac2[] = "short";
char example_ac3[] = "example_longer";
char example_acx[] = "example_long_excessively";
char example_ace[] = "";
Copy link
Collaborator

Choose a reason for hiding this comment

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

const char

Comment on lines +251 to +255
string example_s1 = "example_long";
string example_s2 = "short";
string example_s3 = "example_longer";
string example_sx = "example_long_excessively";
string example_se = "";
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. const
  2. maybe just string example_s1(example_ac1) or the other way: example_s1.c_str() covers the case of raw char array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Priority: Critical [tests] Area: Unit tests Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants