mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-18 15:20:56 +03:00
kex: fix overlapping memcpy() to memmove()
Noticed this when libasan started kicking out errors when sending in MACs preferences that were not supported yet. Reported-by: fourierules on github Fixes #611 Closes #1000
This commit is contained in:
@@ -4027,7 +4027,7 @@ libssh2_session_method_pref(LIBSSH2_SESSION * session, int method_type,
|
||||
if(!kex_get_method_by_name(s, method_len, mlist)) {
|
||||
/* Strip out unsupported method */
|
||||
if(p) {
|
||||
memcpy(s, p + 1, strlen(s) - method_len);
|
||||
memmove(s, p + 1, strlen(s) - method_len);
|
||||
}
|
||||
else {
|
||||
if(s > newprefs) {
|
||||
|
||||
Reference in New Issue
Block a user