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 to possible memory corruption #778

Merged
merged 1 commit into from Jun 17, 2019
Merged

fix to possible memory corruption #778

merged 1 commit into from Jun 17, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jun 3, 2019

b >> reinterpret_cast< ByteStream::doublebyte&>(fAsc); casts a byte to a short so two bytes get written to fAsc.

@ghost ghost requested review from davidhall586 and drrtuy June 3, 2019 08:40
@davidhall586
Copy link
Contributor

I think it would be a better solution to add bool as a supported type to bytestream, rather than make a copy like this. Using sizeof(bool), we could determine the proper number of bytes to move into the stream.

@drrtuy
Copy link
Collaborator

drrtuy commented Jun 3, 2019

ByteStream divides supported data types in floats and ints future dividing ints by width so I would just use byte + cast instead in ser/des functions.

@ghost
Copy link
Author

ghost commented Jun 15, 2019

I think it would be a better solution to add bool as a supported type to bytestream, rather than make a copy like this. Using sizeof(bool), we could determine the proper number of bytes to move into the stream.

I began removing all the overloads and creating a handful of specializations. One implementation handled POD while a few other handled containers. This exposed a couple bigger problems with the bytestream implementation that need to be addressed. I don't want to add to the pile right now.

@ghost ghost closed this Jun 17, 2019
@ghost ghost reopened this Jun 17, 2019
@davidhall586 davidhall586 merged commit a97a2c1 into mariadb-corporation:develop-1.2 Jun 17, 2019
@ghost ghost deleted the branches/davidjmott/MCOL-3353 branch July 15, 2019 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants