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

Fix uninitialized variables. #536

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

walterj-adsk
Copy link

clang-tidy found an issue with the cereal library during static
analysis. It indicated that data could end up uninitialized. The fix
involves setting reasonable default values before values are read by
the cereal library.

The contribution is being made by Autodesk Inc. under the terms of the
BSD license.

clang-tidy found an issue with the cereal library during static
analysis. It indicated that data could end up uninitialized.  The fix
involes setting reasonable default values before values are read by
the cereal library.

The contribution is being made by Autodesk Inc. under the terms of the
BSD license.
@crazyhappygame
Copy link
Contributor

Hi could you accept this pull request?

And also initialize with {} other size_types.
There is random crash on mac because of uninitialized size
include/cereal/types/vector.hpp:78: size_type size;

$ git grep -n "^\s*size_type"
include/cereal/types/concepts/pair_associative_container.hpp:52:    size_type size;
include/cereal/types/deque.hpp:52:    size_type size;
include/cereal/types/forward_list.hpp:45:    size_type const size = std::distance( forward_list.begin(), forward_list.end() );
include/cereal/types/forward_list.hpp:58:    size_type size;
include/cereal/types/list.hpp:52:    size_type size;
include/cereal/types/set.hpp:54:      size_type size;
include/cereal/types/string.hpp:53:    size_type size;
include/cereal/types/unordered_set.hpp:54:      size_type size;
include/cereal/types/valarray.hpp:56:    size_type valarraySize;
include/cereal/types/valarray.hpp:80:    size_type valarraySize;
include/cereal/types/vector.hpp:54:    size_type vectorSize;
include/cereal/types/vector.hpp:78:    size_type size;
include/cereal/types/vector.hpp:99:    size_type size;

@AzothAmmo AzothAmmo changed the base branch from master to develop July 24, 2019 06:08
@AzothAmmo AzothAmmo added this to the v1.4.0 milestone Nov 3, 2019
@AzothAmmo AzothAmmo changed the base branch from develop to master November 3, 2019 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants