]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2004/01/19 21:25:15
authordjm <djm>
Wed, 21 Jan 2004 00:02:50 +0000 (00:02 +0000)
committerdjm <djm>
Wed, 21 Jan 2004 00:02:50 +0000 (00:02 +0000)
     [auth2-hostbased.c auth2-pubkey.c serverloop.c ssh-keysign.c sshconnect2.c]
     fix mem leaks; some fixes from Pete Flugstad; tested dtucker@

ChangeLog
auth2-hostbased.c
auth2-pubkey.c
serverloop.c
ssh-keysign.c
sshconnect2.c

index 0218210af57420244444278e38ed5ce44e80b0bf..d9168f6ae608d57a7c1f66f2872727bf7a928121 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,9 @@
      fake consumption for half closed channels since the peer is waiting for
      window adjust messages; bugzilla #790 Matthew Dillon; test + ok dtucker@
      reproduce with sh -c 'ulimit -f 10; ssh host -n od /bsd | cat > foo'
+   - markus@cvs.openbsd.org 2004/01/19 21:25:15
+     [auth2-hostbased.c auth2-pubkey.c serverloop.c ssh-keysign.c sshconnect2.c]
+     fix mem leaks; some fixes from Pete Flugstad; tested dtucker@
 
 20040114
  - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits
index 505d3eff458758323cb9688f12692857c587b7f1..1111ed67a643223635f25ae73b528213a74a4099 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2-hostbased.c,v 1.5 2003/06/24 08:23:46 markus Exp $");
+RCSID("$OpenBSD: auth2-hostbased.c,v 1.6 2004/01/19 21:25:15 markus Exp $");
 
 #include "ssh2.h"
 #include "xmalloc.h"
@@ -114,7 +114,7 @@ userauth_hostbased(Authctxt *authctxt)
                        buffer_len(&b))) == 1)
                authenticated = 1;
 
-       buffer_clear(&b);
+       buffer_free(&b);
 done:
        debug2("userauth_hostbased: authenticated %d", authenticated);
        if (key != NULL)
index c28571ab6c774fd50c6d215b8beecb661bb3d2d7..3063eecc3974d63c6cc50f11a0aec81dde57ae4c 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2-pubkey.c,v 1.5 2003/11/04 08:54:09 djm Exp $");
+RCSID("$OpenBSD: auth2-pubkey.c,v 1.6 2004/01/19 21:25:15 markus Exp $");
 
 #include "ssh2.h"
 #include "xmalloc.h"
@@ -123,9 +123,9 @@ userauth_pubkey(Authctxt *authctxt)
                authenticated = 0;
                if (PRIVSEP(user_key_allowed(authctxt->pw, key)) &&
                    PRIVSEP(key_verify(key, sig, slen, buffer_ptr(&b),
-                               buffer_len(&b))) == 1)
+                   buffer_len(&b))) == 1)
                        authenticated = 1;
-               buffer_clear(&b);
+               buffer_free(&b);
                xfree(sig);
        } else {
                debug("test whether pkalg/pkblob are acceptable");
index bc7cd656afd8e9bac1e44684265685d2d2de1a40..a777a048d79ead3654aa55733d3bcd6ab09f973d 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.114 2003/12/09 15:28:43 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.115 2004/01/19 21:25:15 markus Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
@@ -850,7 +850,7 @@ server_input_window_size(int type, u_int32_t seq, void *ctxt)
 }
 
 static Channel *
-server_request_direct_tcpip(char *ctype)
+server_request_direct_tcpip(void)
 {
        Channel *c;
        int sock;
@@ -872,14 +872,14 @@ server_request_direct_tcpip(char *ctype)
        xfree(originator);
        if (sock < 0)
                return NULL;
-       c = channel_new(ctype, SSH_CHANNEL_CONNECTING,
+       c = channel_new("direct-tcpip", SSH_CHANNEL_CONNECTING,
            sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT,
            CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1);
        return c;
 }
 
 static Channel *
-server_request_session(char *ctype)
+server_request_session(void)
 {
        Channel *c;
 
@@ -891,7 +891,7 @@ server_request_session(char *ctype)
         * SSH_CHANNEL_LARVAL.  Additionally, a callback for handling all
         * CHANNEL_REQUEST messages is registered.
         */
-       c = channel_new(ctype, SSH_CHANNEL_LARVAL,
+       c = channel_new("session", SSH_CHANNEL_LARVAL,
            -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
            0, "server-session", 1);
        if (session_open(the_authctxt, c->self) != 1) {
@@ -920,9 +920,9 @@ server_input_channel_open(int type, u_int32_t seq, void *ctxt)
            ctype, rchan, rwindow, rmaxpack);
 
        if (strcmp(ctype, "session") == 0) {
-               c = server_request_session(ctype);
+               c = server_request_session();
        } else if (strcmp(ctype, "direct-tcpip") == 0) {
-               c = server_request_direct_tcpip(ctype);
+               c = server_request_direct_tcpip();
        }
        if (c != NULL) {
                debug("server_input_channel_open: confirm %s", ctype);
index b3db628c69c7bddb585461989a085507927e1335..9e9ebe2f1717328db9c2d7ceaa6d5bd844e275be 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keysign.c,v 1.14 2003/11/17 09:45:39 djm Exp $");
+RCSID("$OpenBSD: ssh-keysign.c,v 1.15 2004/01/19 21:25:15 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/rand.h>
@@ -126,6 +126,7 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data,
        /* end of message */
        if (buffer_len(&b) != 0)
                fail++;
+       buffer_free(&b);
 
        debug3("valid_request: fail %d", fail);
 
index 281fecdc9553db8998df812566c39860929401e6..3a218113cfb2917e4f2d8cf5c7eb058f232ee8f1 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.133 2003/11/21 11:57:03 djm Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.134 2004/01/19 21:25:15 markus Exp $");
 
 #include "openbsd-compat/sys-queue.h"
 
@@ -1267,7 +1267,7 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp,
 
        if (ssh_msg_recv(from[0], &b) < 0) {
                error("ssh_keysign: no reply");
-               buffer_clear(&b);
+               buffer_free(&b);
                return -1;
        }
        close(from[0]);
@@ -1279,11 +1279,11 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp,
 
        if (buffer_get_char(&b) != version) {
                error("ssh_keysign: bad version");
-               buffer_clear(&b);
+               buffer_free(&b);
                return -1;
        }
        *sigp = buffer_get_string(&b, lenp);
-       buffer_clear(&b);
+       buffer_free(&b);
 
        return 0;
 }
This page took 0.067791 seconds and 5 git commands to generate.