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 out of bounds write in array deserialization #29017

Merged
merged 1 commit into from
Sep 4, 2018
Merged

Conversation

Keno
Copy link
Member

@Keno Keno commented Sep 3, 2018

The array was allocated based on the serialized elsize of the array,
however, unions get an extra selector array after the regular storage
which was not allocated (because we didn't know it was gonna be a union
array at the time when we allocated it). According to
a48eeef we cannot look at the element
type to allocate the array, so we need to serialize a bit to indicate
that we will have a union array.

Fixes #28998

@quinnj
Copy link
Member

quinnj commented Sep 3, 2018

Hmm, I wonder why we never saw any issues w/ the test here; is precompilation deserialization different in some way?

The array was allocated based on the serialized `elsize` of the array,
however, unions get an extra selector array after the regular storage
which was not allocated (because we didn't know it was gonna be a union
array at the time when we allocated it). According to
a48eeef we cannot look at the element
type to allocate the array, so we need to serialize a bit to indicate
that we will have a union array.

Fixes #28998
@Keno
Copy link
Member Author

Keno commented Sep 3, 2018

Yes, different serialization format, implemented in C and not user extensible, since it needs to be available without any julia code loaded.

@KristofferC KristofferC mentioned this pull request Sep 3, 2018
@Keno Keno merged commit e7d7259 into master Sep 4, 2018
@martinholters martinholters deleted the kf/oobarraydes branch September 5, 2018 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants