#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-develReceived on 2015-06-01