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

[sre] Handle null values in MarshalAsAttribute CustomAttributeBuilder #12872

Merged
merged 1 commit into from
Feb 8, 2019

Conversation

lambdageek
Copy link
Member

Normally strings are encoded as length-then-utf8 in ECMA-335. But a null
String is encoded as just the byte 0xFF.

When we make a CustomAttributeBuilder for a MarshalAsAttribute and attach it to
some parameter we first encode the CAB as a byte blob and then decode it in
CAB.get_umarshal into a UnmanagedMarshal attribute. But the decoding didn't
account for the possibility of null strings.

Fixes #12747

Normally strings are encoded as length-then-utf8 in ECMA-335.  But a null
String is encoded as just the byte 0xFF.

When we make a CustomAttributeBuilder for a MarshalAsAttribute and attach it to
some parameter we first encode the CAB as a byte blob and then decode it in
CAB.get_umarshal into a UnmanagedMarshal attribute.  But the decoding didn't
account for the possibility of null strings.

Fixes mono#12747
@lambdageek
Copy link
Member Author

@monojenkins backport to 2019-02

@lambdageek
Copy link
Member Author

@monojenkins backport to 2018-12

@lambdageek
Copy link
Member Author

@monojenkins backport to 2018-10

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.

3 participants