1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00

Merge pull request #180 from ronnychevalier/rc/coverity_cid_1304686

login: fix potential null pointer dereference
This commit is contained in:
Lennart Poettering 2015-06-15 12:22:19 +02:00
commit f430b07b72

View File

@ -763,6 +763,9 @@ static int elect_display_compare(Session *s1, Session *s2) {
* is preferred.
*
* s1 or s2 may be NULL. */
if (!s1 && !s2)
return 0;
if ((s1 == NULL) != (s2 == NULL))
return (s1 == NULL) - (s2 == NULL);