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

Update buffermgrdyn.cpp #3435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marwanelmessiry72
Copy link

What I did
i added if condetion that will ensure that the poolobj.direction will not size of the string m_bufferZeroProfileName so that the string will not get out of boundaries
Why I did it
as the checkmarx tool was telling this as high severity valunerability in the code
How I verified it
added the if condition and regenerated a repoert and the valunerability disappeared
Details if related
so based on that this will also make it safe in case any one add any value to the enum of the poolobj.direction as it will make safe from being out of boundaries

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

linux-foundation-easycla bot commented Dec 20, 2024

CLA Signed

  • ✅login: marwanelmessiry72 / (9c2eb33)

The committers listed above are authorized under a signed CLA.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -325,10 +325,13 @@ void BufferMgrDynamic::loadZeroPoolAndProfiles()
auto &poolObj = poolSearchRef->second;
if (poolObj.zero_profile_name.empty())
{
if(poolObj.direction>= 0 && poolObj.direction <= 2) // ensuring the poolpbj.direction will not get out of boundaries
Copy link
Collaborator

Choose a reason for hiding this comment

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

please fix alignment

@prsunny prsunny requested a review from kperumalbfn January 6, 2025 19:31
@prsunny
Copy link
Collaborator

prsunny commented Jan 6, 2025

@mramezani95 to review

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