From 0778c04fab228de59ca13fcf7d332868a27e4d87 Mon Sep 17 00:00:00 2001 From: stefanocasazza Date: Thu, 21 Dec 2017 17:14:51 +0100 Subject: [PATCH] ssh fix --- src/ulib/ssh/net/sshsocket.cpp | 4 +++- tests/.function | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ulib/ssh/net/sshsocket.cpp b/src/ulib/ssh/net/sshsocket.cpp index a70f9325..77e9220a 100644 --- a/src/ulib/ssh/net/sshsocket.cpp +++ b/src/ulib/ssh/net/sshsocket.cpp @@ -258,7 +258,9 @@ bool USSHSocket::connectServer(const UString& server, unsigned int iServPort, in { USocket::iRemotePort = iServPort; #endif - const char* srv = server.c_str(); + U_INTERNAL_ASSERT(server.isNullTerminated()) + + const char* srv = server.data(); (void) U_SYSCALL(ssh_options_set, "%p,%d,%S", session, SSH_OPTIONS_HOST, srv); (void) U_SYSCALL(ssh_options_set, "%p,%d,%p", session, SSH_OPTIONS_PORT, &iServPort); diff --git a/tests/.function b/tests/.function index 1d546391..82fbcbca 100644 --- a/tests/.function +++ b/tests/.function @@ -303,7 +303,8 @@ check_for_netcat() { if [ $? -eq 0 ]; then NC_TEST=`netcat -h 2>&1 | head -n 1` - if [ "$NC_TEST" = "[v1.10]" ]; then + if [ "$NC_TEST" = "[v1.10]" ] || \ + [ "$NC_TEST" = "[v1.10-41]" ]; then NCAT=netcat elif [ "`echo $NC_TEST | cut -d' ' -f1`" = "GNU" ]; then NCAT=netcat