URL: https://github.com/SSSD/sssd/pull/5709
Title: #5709: General: Hardeninig getenv() usage

mzidek-gh commented:
"""
Btw. to re-iterate what is the main problem with the current version. The "out 
of memory" and "no such variable" cases are not distinguished. That was the 
main motivation behind suggesting the function that would return two error 
codes. However, you can solve it also differently, by not using the function 
and just first calling the getenv, handling the NULL from it as "no such 
variable" and right after that copying it with talloc and handling the NULL 
from talloc as ENOMEM (all this before the the value is passed down to some 
other functions). The reason why I suggested the function was because I though 
it will be easier to reuse, but if the issue is only on a handful of places, 
not using a function and just adding more checks is OK too. It is up to you :)
"""

See the full comment at 
https://github.com/SSSD/sssd/pull/5709#issuecomment-884162742
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to