mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-23 01:22:37 +03:00
Session.c : banner_receive() from leaking when accessing non ssh ports (#356)
File : session.c Release previous banner in banner_receive() if the session is reused after a failed connection. Credit : Ryan Kelley
This commit is contained in:
committed by
Will Cosgrove
parent
2b45dfcad7
commit
9d13d86627
@@ -170,6 +170,9 @@ banner_receive(LIBSSH2_SESSION * session)
|
||||
if(!banner_len)
|
||||
return LIBSSH2_ERROR_BANNER_RECV;
|
||||
|
||||
if(session->remote.banner)
|
||||
LIBSSH2_FREE(session, session->remote.banner);
|
||||
|
||||
session->remote.banner = LIBSSH2_ALLOC(session, banner_len + 1);
|
||||
if(!session->remote.banner) {
|
||||
return _libssh2_error(session, LIBSSH2_ERROR_ALLOC,
|
||||
|
||||
Reference in New Issue
Block a user