mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[fix] fix strncpy error
This commit is contained in:
@@ -159,9 +159,11 @@ int Render::ConnectTo(const std::string &remote_id, const char *password,
|
|||||||
auto props = client_properties_[remote_id];
|
auto props = client_properties_[remote_id];
|
||||||
if (!props->connection_established_) {
|
if (!props->connection_established_) {
|
||||||
props->remember_password_ = remember_password;
|
props->remember_password_ = remember_password;
|
||||||
if (strcmp(password, "") != 0) {
|
if (strcmp(password, "") != 0 &&
|
||||||
|
strcmp(password, props->remote_password_) != 0) {
|
||||||
strncpy(props->remote_password_, password,
|
strncpy(props->remote_password_, password,
|
||||||
sizeof(props->remote_password_));
|
sizeof(props->remote_password_) - 1);
|
||||||
|
props->remote_password_[sizeof(props->remote_password_) - 1] = '\0';
|
||||||
}
|
}
|
||||||
ret = JoinConnection(props->peer_, remote_id.c_str(), password);
|
ret = JoinConnection(props->peer_, remote_id.c_str(), password);
|
||||||
if (0 == ret) {
|
if (0 == ret) {
|
||||||
|
|||||||
2
thirdparty/projectx
vendored
2
thirdparty/projectx
vendored
Submodule thirdparty/projectx updated: 5b2961df18...1621ab04ed
Reference in New Issue
Block a user