Subject: [libssh2] #306: Overlapping memcpy in libssh2_session_method_pref

[libssh2] #306: Overlapping memcpy in libssh2_session_method_pref

From: libssh2 Trac <trac_at_libssh2.stuge.se>
Date: Mon, 01 Jun 2015 13:57:55 -0000

#306: Overlapping memcpy in libssh2_session_method_pref
-----------------------+--------------------
 Reporter: omoerbeek | Owner:
     Type: defect | Status: new
 Priority: normal | Milestone: 1.4.3
Component: API | Version: 1.4.2
 Keywords: | Blocked By:
   Blocks: |
-----------------------+--------------------
 For memcpy, having overlapping src and dest means undefined behaviour.

 In libssh2_session_method_pref() the memcpy in the while loop is obviously
 overlapping.

 Replace by memmove to fix.

 Found by OpenBSD strict memcpy.

 Regards, Otto Moerbeek

-- 
Ticket URL: <https://trac.libssh2.org/ticket/306>
libssh2 <https://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2015-06-01