Skip to content

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.

@ThijsvDorp ThijsvDorp closed this by deleting the head repository Jun 22, 2025
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