summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2018-01-23 07:00:19 -0500
committerChris Michael <cp.michael@samsung.com>2018-01-23 07:00:19 -0500
commit382e1a89574cbc9a944257762121925ea644cd1a (patch)
treebd35790cba22759a391a2cf8058444095a46d7d0 /src/lib/elput
parent32f8e0c7268182d5a6d2bb57003d8211e4e67601 (diff)
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>
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_logind.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index ba7be0a763..82ce11ff16 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -523,7 +523,7 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
523 goto seat_err; 523 goto seat_err;
524 } 524 }
525 525
526 if (!strcmp(seat, "seat0")) 526 if ((seat) && (!strcmp(seat, "seat0")))
527 { 527 {
528 if (!_logind_session_vt_get(em->sid, &em->vt_num)) 528 if (!_logind_session_vt_get(em->sid, &em->vt_num))
529 { 529 {