From 9a6e0d576dc8955b668a3a775c0521c8d94f2131 Mon Sep 17 00:00:00 2001 From: John Hood Date: Tue, 10 May 2016 23:58:56 -0400 Subject: [PATCH] Coverity fixes: deref of NULL pointers We were potentially passing (char *)NULL to string constructors. --- src/frontend/stmclient.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/stmclient.h b/src/frontend/stmclient.h index 310102b..15cbfb4 100644 --- a/src/frontend/stmclient.h +++ b/src/frontend/stmclient.h @@ -84,7 +84,8 @@ private: public: STMClient( const char *s_ip, const char *s_port, const char *s_key, const char *predict_mode ) - : ip( s_ip ), port( s_port ), key( s_key ), + : ip( s_ip ? s_ip : "" ), port( s_port ? s_port : "" ), + key( s_key ? s_key : "" ), escape_key( 0x1E ), escape_pass_key( '^' ), escape_pass_key2( '^' ), escape_requires_lf( false ), escape_key_help( L"?" ), saved_termios(), raw_termios(),