diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-01 21:24:16 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-01 21:24:16 +0000 |
commit | 891539af6cbdbdfabb8d37fb491f7f8cadf9823c (patch) | |
tree | 1699cb47cd68dc35a972f8b5e1d834946c48d944 /libssh/server.c | |
parent | 1b627b386763e22a7b8f7a7c8de9610c1da56cd2 (diff) | |
download | libssh-891539af6cbdbdfabb8d37fb491f7f8cadf9823c.tar.gz libssh-891539af6cbdbdfabb8d37fb491f7f8cadf9823c.tar.xz libssh-891539af6cbdbdfabb8d37fb491f7f8cadf9823c.zip |
Add memory error checks for crypto wrapper functions.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@330 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/server.c')
-rw-r--r-- | libssh/server.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libssh/server.c b/libssh/server.c index 65903de..6cc0087 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -307,7 +307,10 @@ static int dh_handshake_server(SSH_SESSION *session){ crypto_free(session->current_crypto); /* XXX later, include a function to change keys */ session->current_crypto=session->next_crypto; - session->next_crypto=crypto_new(); + session->next_crypto = crypto_new(); + if (session->next_crypto == NULL) { + return -1; + } return 0; } /* do the banner and key exchange */ |