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

Possible dereference of NULL #70

Closed
VoroninArtemii opened this issue Aug 26, 2024 · 1 comment
Closed

Possible dereference of NULL #70

VoroninArtemii opened this issue Aug 26, 2024 · 1 comment

Comments

@VoroninArtemii
Copy link

VoroninArtemii commented Aug 26, 2024

There is a possible derefernce of NULL here:

cacheentry = dict_get(dn2uid_cache, dn);

The pointer dn2uid is checked here and we don't do anything after this block if the memory has not been allocated:
if (dn2uid_cache == NULL)
dn2uid_cache = dict_new();
if ((dn2uid_cache != NULL) && ((cacheentry = dict_get(dn2uid_cache, dn)) != NULL))

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Voronin.

@arthurdejong
Copy link
Owner

Thanks for pointing this out. It has been fixed in 91bb8c9. It should only be possible to trigger this if a call to malloc() failed.

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

No branches or pull requests

2 participants