Skip to content

Commit

Permalink
cs-backup-locker.c: Exit gracefully if incorrect arguments are
Browse files Browse the repository at this point in the history
given, instead of crashing.
  • Loading branch information
mtwebster committed Jul 24, 2024
1 parent 60ad855 commit 44aaa48
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backup-locker/cs-backup-locker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44aaa48

Please sign in to comment.