elput: Fix null pointer dereference

Coverity reports this as a null pointer dereference, so check for
'seat' existence before comparing with strcmp

Fixes CID1385369

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2018-01-23 07:00:19 -05:00
parent 32f8e0c726
commit 382e1a8957
1 changed files with 1 additions and 1 deletions

View File

@ -523,7 +523,7 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
goto seat_err;
}
if (!strcmp(seat, "seat0"))
if ((seat) && (!strcmp(seat, "seat0")))
{
if (!_logind_session_vt_get(em->sid, &em->vt_num))
{