diff options
Diffstat (limited to 'common/rfb/SSecurityVncAuth.cxx')
-rw-r--r-- | common/rfb/SSecurityVncAuth.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/rfb/SSecurityVncAuth.cxx b/common/rfb/SSecurityVncAuth.cxx index b70f0668..d035f97f 100644 --- a/common/rfb/SSecurityVncAuth.cxx +++ b/common/rfb/SSecurityVncAuth.cxx @@ -123,7 +123,12 @@ VncAuthPasswdParameter::VncAuthPasswdParameter(const char* name, void VncAuthPasswdParameter::getVncAuthPasswd(PlainPasswd *password, PlainPasswd *readOnlyPassword) { ObfuscatedPasswd obfuscated, obfuscatedReadOnly; - getData((uint8_t**)&obfuscated.buf, &obfuscated.length); + std::vector<uint8_t> data = getData(); + obfuscated.length = data.size(); + if (!data.empty()) { + obfuscated.buf = new char[data.size()]; + memcpy(obfuscated.buf, data.data(), data.size()); + } if (obfuscated.length == 0) { if (passwdFile) { |