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

MemoryStream Set: incorrect get size and write to buffer causes exception (C# generator) #71

Closed
BlackTr opened this issue Aug 18, 2022 · 2 comments

Comments

@BlackTr
Copy link

BlackTr commented Aug 18, 2022

E.g. we have input stream with Length = 100 and Capacity = 1000.

public override void Set(MemoryStream value)
...
uint fbeBytesSize = (uint)value.Length; // here we have 100
...
Write(fbeBytesOffset + 4, value.GetBuffer()); // and trying to write 1000

Proposed solution (to c# generator)?

 Write(fbeBytesOffset + 4, value.GetBuffer(), 0, fbeBytesSize);
chronoxor added a commit that referenced this issue Aug 19, 2022
@chronoxor
Copy link
Owner

Thanks for reporting! Fixed in 1.11.0.0

@BlackTr
Copy link
Author

BlackTr commented Aug 19, 2022

Thank you!

@BlackTr BlackTr closed this as completed Aug 19, 2022
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

No branches or pull requests

2 participants