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

[NUI] Fix some svace issues. #5344

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

huayongxu
Copy link
Contributor

Description of Change

WID:56638093 An overflow in the arithmetic expression sizeof(IntPtr) * textures.Count which is used in Marshal.AllocHGlobal(sizeof(IntPtr) * textures.Count) may occur. Please use checked arithmetic to throw IntegerOverflowException in case of overflow instead of possible memory damage

WID:56646651 The iteration number in loop with condition i < _parts.Count - 1 is off by one

WID:56638091 An overflow in the arithmetic expression structSize * vertices.Length which is used in Marshal.AllocHGlobal(structSize * vertices.Length) may occur. Please use checked arithmetic to throw IntegerOverflowException in case of overflow instead of possible memory damage

API Changes

  • ACR:

Copy link

@xuelian-bai xuelian-bai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Copy link
Contributor

@elishateng elishateng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@hyue7 hyue7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@huayongxu huayongxu changed the title Fix some svace issues. [NUI] Fix some svace issues. Jun 20, 2023
@@ -54,7 +54,7 @@ internal VertexBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr,

public void SetData<VertexType>(VertexType[] vertices) where VertexType : struct
{
if (null == vertices)
if (null == vertices || vertices.Length == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor. Could you please add comments about exception (line 52) that we can throw exception if certices length is zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
Thanks.

@dongsug-song dongsug-song merged commit 01a741a into Samsung:DevelNUI Jun 21, 2023
3 checks passed
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.

7 participants