# HG changeset patch # User Guilhem Moulin # Date 1438959608 -28800 # Node ID 5709b15a1b572448402123f03a785af90815dcc8 # Parent 924ff1b959a2de9ed40dfb6f2546d3309ed027b1 Fix segfault with restricted authorized_key files without forced command diff -r 924ff1b959a2 -r 5709b15a1b57 svr-authpubkeyoptions.c --- a/svr-authpubkeyoptions.c Fri Aug 07 21:02:49 2015 +0800 +++ b/svr-authpubkeyoptions.c Fri Aug 07 23:00:08 2015 +0800 @@ -91,7 +91,7 @@ /* Set chansession command to the one forced * by any 'command' public key option. */ void svr_pubkey_set_forced_command(struct ChanSess *chansess) { - if (ses.authstate.pubkey_options) { + if (ses.authstate.pubkey_options && ses.authstate.pubkey_options->forced_command) { if (chansess->cmd) { /* original_command takes ownership */ chansess->original_command = chansess->cmd;