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

Fix NULL pointer dereference in tgetstr function (CVE-2023-45918) #4

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

Conversation

ThijsvDorp
Copy link

Description:

This PR fixes a NULL pointer dereference in the tgetstr function within lib_termcap.c. This issue was identified in CVE-2023-45918, which could cause the program to crash when invalid or unrecognized termcap capabilities were requested.

Problem:
The tgetstr function could return a NULL pointer when an invalid capability was passed, and this pointer was not checked before dereferencing it. This resulted in potential crashes due to memory access violations.

Solution:
Added a check for NULL before dereferencing the result of tgetstr.
If the result is NULL, the function now handles the error gracefully instead of attempting to dereference the invalid pointer.

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.

1 participant