jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.87k stars 424 forks source link

Fix segfault for LDAP-authenticated users #860

Open aaronokano opened 2 years ago

aaronokano commented 2 years ago

If a user is logged in via LDAP, some implementations of getpwuid() seem to return NULL. Dereferencing this pointer will cause a segfault. This change avoids dereferencing the potential NULL pointer.

rumpeltux commented 2 years ago

Thanks for the patch! LGTM, I hope the owners can soon merge this. This can also happen if the apparmor profile that comes with debian is enabled which doesn’t grant read access to /etc/passwd*.