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

Resolving the buffer accessed out of bound issue. #113

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

quic-anankulk
Copy link
Contributor

While packing shared buffer with names of all shared objects present in custom DSP_LIBRARY_PATH , their is a possibility of buffer overflow if the shared object names are exceeding the desired limit.The change makes sure the limit is not exceeded thus avoiding buffer overflow. Also, the buffer was allocated with 1KB memory which might fall short to accomodate all the needed shared object names so, increasing this size to 2KB.

While packing shared buffer with names of all shared objects present
in custom DSP_LIBRARY_PATH , their is a possibility of buffer overflow
if the shared object names are exceeding the desired limit.The change
makes sure the limit is not exceeded thus avoiding buffer overflow.
Also, the buffer was allocated with 1KB memory which might fall short
to accomodate all the needed shared object names so, increasing this
size to 2KB.

Signed-off-by: Anand Kulkarni <quic_anankulk@quicinc.com>
goto bail;
}
std_strlcat(*lib_names, file, MAX_NON_PRELOAD_LIBS_LEN);
concat_len = std_strlcat(*lib_names, ";", MAX_NON_PRELOAD_LIBS_LEN);
}
}
}
closedir(dir);
Copy link
Contributor

@quic-mtharu quic-mtharu Nov 22, 2024

Choose a reason for hiding this comment

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

Add a null check before calling closedir(dir) to ensure we are not attempting to close an invalid directory stream.

if (dir != NULL) {
    closedir(dir);
}

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.

2 participants