From 44aaa483c84cac4402216302e123b90a9d789088 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Wed, 24 Jul 2024 12:24:39 -0400 Subject: [PATCH] cs-backup-locker.c: Exit gracefully if incorrect arguments are given, instead of crashing. --- backup-locker/cs-backup-locker.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backup-locker/cs-backup-locker.c b/backup-locker/cs-backup-locker.c index a27eee2d..b62422e7 100644 --- a/backup-locker/cs-backup-locker.c +++ b/backup-locker/cs-backup-locker.c @@ -631,6 +631,11 @@ main (int argc, g_debug ("backup-locker: initializing"); + if (!xid_str || !term_tty_str || !session_tty_str) { + g_critical ("xid, term and session arguments are mandatory, exiting."); + exit (1); + } + gulong xid = term_tty = session_tty = 0; xid = strtoul (xid_str, NULL, 0);