-
Notifications
You must be signed in to change notification settings - Fork 552
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
solving out of boundaries vulnerability in fpmlink.cpp #3456
base: master
Are you sure you want to change the base?
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
fpmsyncd/fpmlink.cpp
Outdated
@@ -208,7 +208,14 @@ uint64_t FpmLink::readData() | |||
size_t start = 0, left; | |||
ssize_t read; | |||
|
|||
read = ::read(m_connection_socket, m_messageBuffer + m_pos, m_bufSize - m_pos); | |||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix alignment
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -208,7 +208,14 @@ uint64_t FpmLink::readData() | |||
size_t start = 0, left; | |||
ssize_t read; | |||
|
|||
try | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please correct the indentation?
@@ -1877,8 +1877,14 @@ uint64_t MclagLink::readData() | |||
size_t start = 0, left = 0; | |||
ssize_t read = 0; | |||
char * msg = NULL; | |||
|
|||
try{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to have braces in newline.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
What I did
i added try and catch in line 211
Why I did it
to solve vulnerability as it is adding m_messageBuffer to m_pos without ensuring it is more than the m_bufSize - m_pos
How I verified it
by using checkmarx as it was marked high severity risk at the beginning and then it is solved after the edits