From c8fe5a3999809dfe861a3ba8d7618fdfd4023948 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 16 Apr 2012 03:26:07 -0400 Subject: [PATCH] mosh-client: Return true for still_connecting if !network Fixes: $ MOSH_KEY=foo ./mosh-client 127.0.0.1 60010 Crypto exception: Key must be 22 letters long. Segmentation fault Closes #189. --- src/frontend/stmclient.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/stmclient.h b/src/frontend/stmclient.h index 35716ad..d13bb26 100644 --- a/src/frontend/stmclient.h +++ b/src/frontend/stmclient.h @@ -53,7 +53,11 @@ private: void output_new_frame( void ); - bool still_connecting( void ) { return (network->get_remote_state_num() == 0); } + bool still_connecting( void ) + { + /* Initially, network == NULL */ + return ( !network ) || ( network->get_remote_state_num() == 0 ); + } public: STMClient( const char *s_ip, int s_port, const char *s_key, const char *predict_mode )