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:
commit
f430b07b72
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user