From ef6491a5c9315a921dacbf1b92431fadf96bd1af Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 1 Mar 2019 05:48:33 +0100 Subject: [PATCH] Build with QT_NO_CAST_FROM_BYTEARRAY & QT_NO_CAST_TO_ASCII --- CMakeLists.txt | 2 ++ krfb/rfbclient.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c5a5d7..7bb6d7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,6 +60,8 @@ add_definitions( -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050600 -DQT_USE_FAST_OPERATOR_PLUS + -DQT_NO_CAST_TO_ASCII + -DQT_NO_CAST_FROM_BYTEARRAY -DQT_STRICT_ITERATORS -DQT_NO_URL_CAST_FROM_STRING -DQT_NO_SIGNALS_SLOTS_KEYWORDS diff --git a/krfb/rfbclient.cpp b/krfb/rfbclient.cpp index 28775db..16cb764 100644 --- a/krfb/rfbclient.cpp +++ b/krfb/rfbclient.cpp @@ -221,10 +221,10 @@ bool PendingRfbClient::vncAuthCheckPassword(const QByteArray& password, const QB bzero(passwd, MAXPWLEN); if (!password.isEmpty()) { - strncpy(passwd, password, + strncpy(passwd, password.constData(), (MAXPWLEN <= password.size()) ? MAXPWLEN : password.size()); } rfbEncryptBytes(challenge, passwd); - return memcmp(challenge, encryptedPassword, encryptedPassword.size()) == 0; + return memcmp(challenge, encryptedPassword.constData(), encryptedPassword.size()) == 0; }